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.
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
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.
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.
Yes I am using the same way you have mentioned in all the three points. It is the source of the Table. It has been used in the expression and also in List sort. List is getting sorted, but on table it is not showing sorted data.
Regards,
Bhagyashree S
And you are working on Reactive, right? (If it was Traditional Web you would need to AJAX refresh the table).
That is strange. Can you share the OML to take a closer look?
João
Yes, I am working on Reactive. I cannot share OML but added screenshots:
Tier3_YearEstimates is the record list.
2. Used in expression:
3. List sort Action:
3. Sort Attribute is also using the variable:
Hi @João Marques, thanks for sharing solution. I am trying with your oml. It is working fine, but the sorting happen for current page only. Can you help on this for sorting all records. Thanks in advance.