Friday, February 18, 2011

Grid Row Selection Indicator

PeopleSoft grids have the option of using a single or multi-row selection indicator. A single row selection indicator is a radio button (one option) while a multi-row selection indicator is a check box. You can use this functionality to get the user to select the row(s) they are interested in.

These settings are in the page field properties of the grid (under the Use tab):

image

This all works really well, but what is the event triggered by user when they use these selection indicators? Well, there isn't one — well not in the sense of a field change anyway. However, there is a Set Component Changed option in the grid properties, which, when set, will trigger a save event when the user sets or changes the selection indicator(s).

So, if a user selects a row in the grid (single selection radio button), when they press save, PeopleSoft will recognise this event and fire off any code in SaveEdit, SavePreChange, or SavePostChange

Here is a snippet of PeopleCode you could use to process the row(s) selected by the user and perform an action:
Local Rowset &rs_YOUR_RECORD;
Local integer &i;
&rs_YOUR_RECORD = GetLevel0()(1).GetRowset(Scroll.YOUR_RECORD);
For &i = 1 to &rs_YOUR_RECORD.ActiveRowCount
If &rs_YOUR_RECORD(&i).Selected = True Then
/* This is a row selected by the user, do something here */
End-If;
End-For;

2 comments:

1708a05c-6b91-11e0-a217-000bcdcb8a73 said...

Hi,
Can rowselection indicator in grid Properties can be accessed by any PeopleCode function.
And i want to enable or disable as per the requirement.
Is it possible if not pls suggest any other way.

Pawan Mundhra said...

No you have to use SELECTED PeopleCode for selecting the row.
You can use a Work-record for your processing.

Post a Comment