11
Views
6
Comments
Solved
Sorting List variable doesn't updates on Table in reactive
Question
Application Type
Reactive

I have a list. It is an input to the Table widget. I am not using Aggregate/SQL as data source for Table.  My use case is different, I need to use List variable and display it's data on Table. I want to sort the table based on the column. In sort action I have used ListSort Client action. The list gets sorted but it is not reflecting on the Table widget. It is not getting binded to the Table.

Solution

Hi João ,

Yes the Tablesort, ListSort and ascending logic is proper. By adding switch case and different Listsort for every attribute as mentioned by you, the Table is now getting sorted.

Thank you so much. 


Thanks & Regards,

Bhagyashree S.

Rank: #70
Solution

Hi Baghyashree,


You are always sorting by YearEstimates.Category and I'm not sure if you're editing the TableSort variable which might explain why the Ascending isn't working either.

If you want to simulate the OnSort built-in action by OutSystems, I'm afraid you'll have to have a different ListSort for every attribute. I managed to put it working by controlling the Ascending via a variable IsSortAscending. My flow looks like this:


Depending on the clicked column, I'll perform a ListSort on the corresponding attribute.

An example OML is in attachment.


Regards,
João

ExampleSortList.oml

Rank: #70

Hi Bhagyashree,


Can you confirm three things:


1. Do you have the local variable as the Source of the Table widget (and not the query)? (in my example the local variable is called ESpaces):


2. Do you have the Expressions (and other widgets) on your Table showing the value from the Local Variable (in my case ESpaces) instead of showing the value from the query?


3. Are you sorting the local variable (in my example ESpaces) on the List attribute from ListSort action instead of the query?


If you have these three things right, it should be working.


Hope it helps.


Regards,
João