[ 
http://issues.apache.org/jira/browse/TOMAHAWK-550?page=comments#action_12421864 
] 
            
Catalin Kormos commented on TOMAHAWK-550:
-----------------------------------------

Ok, thanks for the details. The problem is that setting the sortColumn on the 
dataTable doesn't change the sortPropery to the corresponding value. I can 
suggest another workarround for now and see how this could be actualy resolved 
a little bit later. The workarround involves using the "defaultSorted" 
attribute from <t:column>. You could bind his value into a Map that is in 
session scope, something like the following:

<t:dataTable var="user" value="#{usersBean.users}"                             
                       sortAscending="#{sortDirections.users}">
        <t:column sortable="true" defaultSorted="sortColumns.settings['name']">
                <f:facet name="header">
                        <t:commandSortHeader columnName="name" 
propertyName="name">
                                <h:outputText value="Name "/>
                        </t:commandSortHeader>
                </f:facet>
                <h:outputText value="#{user.name}" 
styleClass="#{disablableStyles[user.disabled]}"/>
        </t:column> 
       ....(more columns here) 

sortColumns.settings['name'], sortColumns in session scope that has a Map field 
(settings) which holds pairs of column names and true/false values. Well, the 
Map would need to be a custom map which allows only one column name to have a 
value of true. I didn't actualy test this, but it should work, if not, it will 
help if you attach a simple war file for testing.

HTH,
Catalin

> Sort property of sortable table is null when sort column is set.
> ----------------------------------------------------------------
>
>                 Key: TOMAHAWK-550
>                 URL: http://issues.apache.org/jira/browse/TOMAHAWK-550
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: Extended Datatable
>    Affects Versions: 1.1.3
>         Environment: JBoss4.0.4.GA
>            Reporter: Alexander Slobodyanik
>
> If sortColumn attribute of dataTable with autosort feature enabled is set to 
> not-null value (for example, if it is stored in session-scope bean), then 
> sortProperty is not set and sorting is not performed.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to