Sorting Table Records under another Tables Records

Hi All,

I have a webscreen where I display a Record List under another Record List and I want to apply the sorting for the child list using List_SortColumn.

The child lists are implemented as Web Block components.

Take the sample table below, we have a list of Objects (Fruit, Animal, Device, etc...) and under each group you have another list of the Object Type (Apple, Lemon, Orange for Fruit, etc.)

Let's say I want to sort the Fruit by Name ASC, and Animal by Quantity DESC, how can I achieve this using OutSystems? 

With my current implementation, everytime I do sorting, it will refresh all Web Blocks and apply the last one into others. So let's say I want to sort Fruit by Name, it will refresh and apply the Device web block to others, and I will have 3 web blocks of Devices instead.

Sample Table

Screen Action

Solution

Hi Eucliwood,


I tried this out in a little example oml, works for me, but not sure if this is the setup you had in mind.


see attached oml, you can test here


Let me know if your requirements are different from this

Dorine

Solution

Hi Dorine,

Thank you for your oml, it is truly a great help. I tested it and can confirm it works as per my intention.

However, when I implements a similar webscreen into my current project, it does not work. When I click on the header to sort, it only call OnNotify once for me and that is all, I cannot do any sorting afterwards.

Do you have any idea of what could be a possible cause for this behavior?

Hi Eucliwood,

it would be easiest if you coud share your oml, so please attach in this post if you are allowed.

In case you can't share, what usually helps a lot is setting some breakpoints and debugging, carefully inspecting all involved variables during the steps leading up to the place where your app doesn't behave the way you expect it to.


Have you compared all aspects of the code between yours and the example I attached ?

Hi Dorine,

Thanks for your response. I will try to debug and find the conflict myself then as I am not able to share the oml I am working on.

Your oml has provided the correct answer for my raised question.

Ok,

good luck, if you can't make it work, then maybe some screenshots of your setup with sensitive stuff blurred out can also help us see what's going on.

Dorine Boudry wrote:

Ok,

good luck, if you can't make it work, then maybe some screenshots of your setup with sensitive stuff blurred out can also help us see what's going on.

I found out it was due to I used a custom class for the table (to handle the responsive display differently) instead of the original one.

Using TableRecords the sorting works correctly.


Thanks for the help.