Monday 24 February 2014

Sorting Listbox Data

Since day 1 Rapide has provided a capability to allow users to sort the data in a desktop and browser listbox by clicking on the column heading. The actual sort logic is coded in an event in the Gen action diagram since this offers maximum flexibility for the developer, for example to provide complex sort logic involving multiple columns or even hidden columns.

The Rapide Designer now provides a utility tool to automatically generate the action diagram events for all relevant listboxes at once. This will allow you to easily support consistent sort functionality for all listboxes.

There are a few points to bear in mind when using sorted listboxes.

Firstly you need to decide if you will initially re-sort the data when the list is first displayed, or use the sort sequence from the logic that populated the group view, usually as returned from the server.

Secondly, when the data changes (for example you allow the user to edit rows or re-populate the listbox), you need to re-sort the listbox data. Since the Rapide generated sort event generates the sort string, this often simply requires you to include a SORT statement within any event that repopulates the group view.

Thirdly, if your listbox does not contain all of the possible data and a paging function is available, then you need to consider whether a sort function is appropriate.

No comments: