EuGrid: How to use onGotFocus for a "cell"?

new topic     » topic index » view thread      » older message » newer message

Hi,

In EuGrid 1.33, a column has ComboBox with all the values defined in a Master.
As a cell for any row in that column gets focus, I would like to display the
corresponding code description in an EditText placed somewhere else on the
screen.

LatestACH is the underlying dataset.
There are 11 columns in dataset, out of which columns 2, 7, 8, 9 are used in
grid.
Column 10, 11 are used to store descriptions for the codes in column 1 and 2
resp.

Column 1 is Static and its description is loaded in column 10 only once.
Column 2 has a ComboBox for which description is stored in column 11.
As the ComboBox value is changed, I would like to store the corresp. description
in
column 11.

How to process GotFocus for a "cell"?

I am setting the required procedure in onEvent for EuGrid.
I tried to set up EditText for EGW_CELLCHANGE and/or EGW_CELLEDIT.
But in case of CELLCHANGE focus moves to next cell/row after the EditText is
setup.
And for CELLEIDT, even after selecting a new value in combo, description doesn't
change.


procedure EuGrid802_onEvent (integer self, integer event, sequence params)
atom rowkey, col_id
object datavalue
sequence currCell

rowkey = iff(params[2] > 0, params[2], 1) col_id = iff(params[3] > 0, params[3], 1)

if find(params[1], {EGW_LEFTBUTTONDOWN}) then void = EGW_SaveCellData(self, {rowkey, col_id}) datavalue = EGW_GetDataRow(self, rowkey) if sequence(datavalue) then setText(EditText806, datavalue[10]&" (ONEVNT-CLICK)") setText(EditText808, datavalue[11]&" (ONEVNT-CLICK)") else setText(EditText806, {}&" (ONEVNT-CLICK)") setText(EditText808, {}&" (ONEVNT-CLICK)") end if elsif params[1] = EGW_CELLCHANGE then void = EGW_SaveCellData(self, {rowkey, col_id}) datavalue = EGW_GetDataCellValue(self, rowkey, ACHDataCols[col_id]) if col_id = 2 then Formula if find(datavalue, ACHFormulae) then LatestACH[rowkey][11] = getMasCodeDesc(4, w32TextToNumber(datavalue), 1) set new formula desc setText(EditText806, LatestACH[rowkey][10]&" (ONEVNT-CELLCHANGE)") setText(EditText808, LatestACH[rowkey][11]&" (ONEVNT-CELLCHANGE)") else returnValue(w32True) Invalid Formula end if elsif col_id = 3 then Amount elsif col_id = 4 then Percentage end if elsif params[1] = EGW_CELLEDIT then void = EGW_SaveCellData(self, {rowkey, col_id}) datavalue = EGW_GetDataCellValue(self, rowkey, ACHDataCols[col_id]) if col_id = 2 then Formula if find(datavalue, ACHFormulae) then LatestACH[rowkey][11] = getMasCodeDesc(4, w32TextToNumber(datavalue), 1) set new formula desc setText(EditText806, LatestACH[rowkey][10]&" (ONEVNT-CELLEDIT)") setText(EditText808, LatestACH[rowkey][11]&" (ONEVNT-CELLEDIT)") end if end if end if

end procedure setHandler( EuGrid802, w32HEvent, routine_id("EuGrid802_onEvent"))

Regards, Rad. }}}

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu