This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
I am working with a List Collection inside a Reusable Part that acts as a data model shared between components. There is a particular list that can be controlled by a Sort control in one of the Views I am displaying.
Using the Sort_List over the property of the List Collection ends up with compile errors. Is there a better alternative than:
Transferring the list collection's contents to a work list
Sorting the working list
Clearing the list collection
Putting back the sorted values from the working list to the list collection
I just want to know if there are any other efficient ways to go about this. The approach above is what I currently have implemented.
The way I display the list is by having all the data lie in a collection in a data model RP. Then the displayed list is controlled by pagination controls (page numbers, sorting, etc.) and gets only the data it needs to display from the data model depending on how the users use the pagination controls.
I did get by using the method I indicated in my original post but was just wondering if there were no other alternatives to that.
I've never tried sorting Keyed Collections before. Do you mean to create a keyed collection keyed by the field I want to sort on? For example PRIM_KCOL<#Price #RP> Or PRIM_KCOL<#Product #RP>?
Unfortunately, I am a bit tight with my schedule right now so I will try this out when things settle down a bit. Thanks a lot.
That is something I have never used nor was aware of. Seems to be an interesting concept.
I am just unsure if that would work while utilizing *ListFields. Ideally, I would have just sorted the LCOL but Sort_List only seems to work for Working Lists. Maybe I will give this a try sometime. Thanks.