I have a push button on my page that is used to refresh my rsApplications rowset. The button's FieldChange PeopleCode is below. It checks to see if the user has sorted any of the columns, and if so, instead of re-selecting and resorting the data, it sets the appropriate key fields in a search record and uses that search record's values to Transfer back to the page.
Local Rowset &rsApplications = GetLevel0()(1).GetRowset(Scroll.MY_RECORD);
&rsApplications.Flush();
If &rsApplications.IsUserSorted(%Page | ".MY_GRIDS_PAGE_FIELD_NAME") Then
Local Record &rec_Search_Rec = CreateRecord(Record.MY_COMPONENTS_SEARCH_RECORD);
&rec_Search_Rec.EMPLID.Value = PERSONAL_DATA.EMPLID;
Transfer( False, @("Menuname." | %Menu), BarName.USE, ItemName.MY_MENU_ITEM, Page.MY_PAGE, %Action_UpdateDisplay, &rec_Search_Rec, True);
Else
&rsApplications.Select(Record.MY_RECORD, "where emplid = :1", PERSONAL_DATA.EMPLID.Value);
&rsApplications.Sort(MY_RECORD.MY_FIRST_COLUMN, "D", MY_RECORD.MY_SECOND_COLUMN, "A");
End-If;
No comments:
Post a Comment