Hello,

In my web application I have a screen with a table of records and I am using the List_SortColumn rich widget on each column to allow sorting by column.  In the preparation aggregate I have used a dynamic sort to initially sort by two columns.

The initial sort and all the sort by columns are working correctly, but how can the user return to the default sort order defined in the preparation ?  I have tried using a 'refresh' button on the screen which performs an ajax refresh of the aggregate in the preparation, but when there is less than a page of records and no changes it seems to ignore the request.

Is there a way to either force the refresh or some other method to return to the default sort order in the preparation if the user wants to do so ?

Cheers, Richard.

Solution

Hi,

Try using the action List_SortColumn_SetOrderBy from richwidget to set the sort column to default column and then refresh the aggregate and do ajax refresh. In the screenshot below I have reset the sort to Id column when user click on reset button.

Regards.

Solution

Hi Prasad,

Thanks, I did not have the List_SortColumn_SetOrderBy action in my application so have added it through the dependencies.  Is it possible to sort on more than one column using this action ?

Cheers, Richard.

Hi,

no, unfortunately you can only sort on one column but below option you can try

1. add a regular status sort after the dynamic one to defaultly second sort column

2 use https://www.outsystems.com/forge/component-overview/1978/multi-sort

Regards

Hi Prasad,

What is the syntax for the Column property in the List_SortColumn_SetOrderBy action ?  Is it "{Entity}.[Attribute]" / "CalculatedAttribute" or something else ?

Cheers, Richard.

Hi Richard,

I would just like to say that: YES, you can order by more than one column using the List_SortColumn_SetOrderBy. Just add the attributes with the syntax that you mentioned ("{Entity}.[Attribute]" / "CalculatedAttribute") separated by commas.

What you add in there is what is sent to the ORDER BY clause in the query (minus the {}[] signs) when you use the List_SortColumn_GetOrderBy in the aggregate.

Cheers,

José

Hi,

I stand corrected, thx @jose. Below is the format

Regards.

José Costa wrote:

Hi Richard,

I would just like to say that: YES, you can order by more than one column using the List_SortColumn_SetOrderBy. Just add the attributes with the syntax that you mentioned ("{Entity}.[Attribute]" / "CalculatedAttribute") separated by commas.

What you add in there is what is sent to the ORDER BY clause in the query (minus the {}[] signs) when you use the List_SortColumn_GetOrderBy in the aggregate.

Cheers,

José

Hi José,

Thanks !  Setting the column property in the List_SortColumn_SetOrderBy action using the syntax "Entity.Attribute" or "CalculatedAttribute" was the missing piece and all is working correctly now.

Unfortunately I can only mark one of the replies as the solution whereas in reality one part was provided by Prasad and one part by yourself !

Cheers, Richard

Richard Pearce wrote:

Unfortunately I can only mark one of the replies as the solution whereas in reality one part was provided by Prasad and one part by yourself !

No problem. I'm glad you solved your issue!

Cheers,

José