RichFaces: free columns DataTable sorting when sorting is enabled multi-column mode

I am currently developing a project (JSF 2.0, RichFaces 3.3.3), in which I have to get 2 be the column DataTable enabled column sorting (I made it through property sortMode="Multi" ), but, unlike the sort of individual columns, in the case of multi-column is impossible for me to release the column or columns on which to sort (this is done in the case of a single column by clicking on another column header).

The sort order is blocked during the session time, even when you switch between the tabs of my web application supports the current settings column sorting. I need to restore the configuration in the session, the user can select a different sort order, because it is currently the only way to reset is output from the system and re-enter.

Example: When a user performs sorting by column A, and then on column B (or vice versa), and given the fact that I also use the property sortPriority (a requirement that I can not change), the combination of the pair AB is blocked at the opening of the current session. When the user needs to sort DataTable only one column (sorting via A or B), it is impossible to obtain in the same session after sorting multiple columns.

Is there a way to achieve "combined column collation"? I need?

Thanks in advance.

UPDATE:

I realized that with only two columns of data in my datatable only way to do it - to switch once the property sortMode between the values of the "Multi" and "Single" . Thus, I would ensure that, while in the sort mode, one column, it will release a combination of columns.

Has anyone successfully worked with the situation when you need to assign values to properties of the rich:dataTable runtime component using javascript?

+4
source share
1 answer

Check out the attributes sortBy and sortOrder rich:dataTable and rich:column . Setting sortOrder="UNSORTED" on the rich:column , it should clear the sort that column. You can also set sortOrder="UNSORTED" and / or sortBy="" on the rich:dataTable for simpler solutions (although I have not tried it). You can do this in JavaScript function onLoad or in the bean, which has attributes associated with its properties.

This should be a bit more elegant than play with sortMode :)

0
source

All Articles