[ 
http://issues.apache.org/jira/browse/TOMAHAWK-550?page=comments#action_12421845 
] 
            
Alexander Slobodyanik commented on TOMAHAWK-550:
------------------------------------------------

Hi,
the use case is allowing user to select preffered sorting (i.e. sort column and 
sort ascending properties) on page once and then have it stored until session 
expires, without need to resort table every time he returns to this page.

Currently, I have such table:

<t:dataTable var="user" value="#{usersBean.users}"
                             sortColumn="#{sortColumns.users}"
                             sortAscending="#{sortDirections.users}">
        <t:column sortable="true" defaultSorted="true">
                <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)

where userBean is in request scope, while sortColumns and sortDirections beans 
- is session scope.
This works fine at first page access (sortColumn is null, sortProperty is 
defined by defaultSorted attribute of column), as well as during resorts and 
other actions on this page, until current view is not removed from server 
session - i.e., user navigates to another page. And, after returning to this 
page, sortColumn already not-null, and sortProperty is not set. This is part of 
log in that case:

<html.ext.HtmlDataTable id="_idJsp21" ... 
sortAscending="#{sortDirections.users}" sortColumn="#{sortColumns.users}" 
sortColumnIndex="0" sortProperty="NULL" sortable="false" ...>

I think, I can attach simple test WAR file, showing up my problem, if it will 
help. Currently, I've wrote extension of HtmlDataTable, with only overriden 
method  - protected DataModel createDataModel(), which gives desired behavior, 
though I don't think that this is a general fix. Please, let me know, if 
attaching it will help.

Thanks in advance,
Alexander.

> 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