(RDMLX) Hidden fields in Tables

Please do not use to report errors- use your regional help desk.
Please mark posts as being for RPG or RDMLX (LANSA) developer.
To subscribe by email, display this forum, scroll to the end and select ‘Subscribe Forum’.
Post Reply
robdorn
Posts: 12
Joined: Sun Nov 04, 2012 7:52 am

(RDMLX) Hidden fields in Tables

Post by robdorn »

I am using the RDMLX version.
Is there a way to access a hidden field in a table when the user presses a check box on the row in the table. I can access the hidden field when I use the onrowclick event.
Mark_Dale
Posts: 61
Joined: Thu Apr 19, 2012 11:06 am

Re: Hidden fields in Tables

Post by Mark_Dale »

The current row of the table doesn't change when the user checks/unchecks the checkbox in the table, so the currentRowId is no use in this case.

What you have to do is add an event parameter to the onValueChange event and read it when processing the event.

Say you added checkboxes to the table rows like this:


Selectlist Named(#employees)

#TableRow := 'Table1.Row%' + #uEntry.AsString

#COM_OWNER.Set_Checkbox Name(#TableRow + '.SELECTCOL') Value(False) Onvaluechange('CHECKBOXCLICK')

#Com_Owner.Set_EventParameter Event(#TableRow + '.SELECTCOL.ONVALUECHANGE') Param_N(1) ParamValue((ID_ + #uEntry.AsString))

#COM_OWNER.Set_Label Name(#TableRow + '.NAMECOL') Text(#EmpName.RightTrim)
#COM_OWNER.Set_Label Name(#TableRow + '.ADDRESSCOL') Text(#EmpAddr.RightTrim)
#COM_OWNER.Set_Table Name(Table1) Row_N(#uEntry) Row_Id((ID_ + #uEntry.AsString)) Row_ID_N(1)

Endselect




Then you read the event parameter in the event handler like this:


When ('= CHECKBOXCLICK')
* The user clicked a checkbox
#COM_OWNER.IsNewForm := False

Com_Owner.Get_EventParameter Param_N(1) ParamValue(#CurrentRow)

#COM_OWNER.Set_Label Text('You checked row: ' + #CurrentRow) Layout_Col(1) Layout_Row(2) Color(Blue)
robdorn
Posts: 12
Joined: Sun Nov 04, 2012 7:52 am

Re: (RDMLX) Hidden fields in Tables

Post by robdorn »

Mark,

This would work ok if I want to execute an event on the row at the time the checkbox is selected. What I am trying to do is select multiple rows using the checkbox and then when a operation button is clicked it will determine the rows with the checkbox selected and process each one. For example I have a table of orders and I click the check box on each order I want to submit for processing and then when I'm done I click a submit operation button to process the orders selected.

Thanks,


Rob
Mark_Dale
Posts: 61
Joined: Thu Apr 19, 2012 11:06 am

Re: (RDMLX) Hidden fields in Tables

Post by Mark_Dale »

In that case, thr processing would be similar to example program LREX0008.

But to read the the row identifier as you read through the table you would do something like:

When ('= ACTION')
* The user pressed SUBMIT

#COM_OWNER.IsNewForm := False

* Load up the list with test data
#Com_Owner.LoadList

* Read through all the entries in Table 1, looking for checked entries
Begin_Loop Using(#uEntry) To(20)

#TableRow := 'Table1.Row%' + #uEntry.AsString

#COM_OWNER.Get_Checkbox Name(#TableRow + '.SELECTCOL') Value(#uSelected)
If (#uSelected)
* Get the selected entry from our work list
Get_Entry Number(#uEntry) From_List(#employees)


#Com_Owner.Get Property(#TableRow + '.ID') InTo(#CurrentRow)

#SelRowIDs += ' ' + #CurrentRow

Endif
End_Loop

#COM_OWNER.Set_Label Text('You selected ' + #SelRowIDs) Layout_Col(1) Layout_Row(2) Color(Blue)
Post Reply