Focal Point
[SOLVED] Maintain Screen refresh problem

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/9317072116

October 18, 2011, 07:25 AM
Shankar
[SOLVED] Maintain Screen refresh problem
Hi All,
I have a maintain screen which have Read/Write Grid with more than 20 columns.When user changes value in any of the column the whole screen get refreshed.Again user has to scroll back to same column to see updated value.User want to stay at the same position in screen while making changes.Is there any way to handle this in maintain?Please suggest.

Thanks in advance.

This message has been edited. Last edited by: Kerry,


WF 8.1.04,Windows 7,
DataBase: Oracle 11g,Output :Excel,PDF,HTML
October 18, 2011, 09:44 AM
Maintain Wizard
Whenever you have a Maintain event (procedure) the application returns to the server and that's why your screen gets refreshed. What many do is use JavaScript instead when ever possible. JavaScript operates on the browser so you do not go back to the server and therefore the screen is not refreshed.

If you have to go to the server you could save the row and column and then when your return to the form, position the cursor on the cell they were on.

Mark
October 19, 2011, 03:53 AM
Shankar
Hi Mark,
Can you please send me sample code for this?That will be really helpful.

Thanks.


WF 8.1.04,Windows 7,
DataBase: Oracle 11g,Output :Excel,PDF,HTML
October 19, 2011, 09:16 AM
Maintain Wizard
I would do something like this.

First I would create two fields in my Maintain code to contain the current row / column of the grid.
Compute Xxx/a5;
Compute Yyy/a5;
Place them on the form and you can make them visible No.

Now, my Grid events would be:
function OnGrid1_OnCellChange ( int col, long row, int newCol, long newRow) {
Form1.Xxx_Edit.value = col;
Form1.Yyy_Edit.value = row;
}

function OnGrid1_OnLClicked ( int col, long row, boolean updn, boolean processed) {
var col1 = Form1.Xxx_Edit.value;
var row1 = Form1.Yyy_Edit.value;
Form1.Grid1.GotoCell(col1, row1);
}

function OnGrid1_Focus ( ) {
Form1.Grid1.StartEdit();
}

The event on Focus makes one click editing work.
The event on OnCellChange takes the current row and column and places them in the fields on the form.
The OnLChicked event says, when the screen is redisplayed and the user clicks on the Grid, place the cursor in the field that you left off on.

Mark
October 21, 2011, 01:00 AM
Shankar
Thanks a lot Mark.

Regards.


WF 8.1.04,Windows 7,
DataBase: Oracle 11g,Output :Excel,PDF,HTML