myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erik-Berndt Scheper (JIRA)" <myfaces-...@incubator.apache.org>
Subject [jira] Commented: (MYFACES-562) <t:commandSortHeader> processes action / actionListener before updating values of sortColumn and sortAscending
Date Thu, 15 Sep 2005 09:55:54 GMT
    [ http://issues.apache.org/jira/browse/MYFACES-562?page=comments#action_12329412 ] 

Erik-Berndt Scheper commented on MYFACES-562:
---------------------------------------------

I was using the nightly build of 2005-09-07, have now changed to the latest nightly build
and it doesn't work.
The examples work OK because they don´t use an action / actionListener to perform the sort.
Instead they call the sort() method in the getter of the List. 

E.g. pagedSortTable.jsp 
The <t:dataTable> tag has sortColumn="#{pagedSort.sort}" and sortColumnAscending="#{pagedSort.ascending}"

Because it has no action / actionListener property, the super.broadcast() method does nothing.
After this the sort / ascending properties of the handler are set to their new values.
This means that these properties are available and correct in the getCars() method of PagedSortableCarList,
which executes the Collections.sort() method.

I would like to use an action / actionListener method of the <t:dataTable> tag to perform
the sort. 
E.g. something like <t:dataTable actionListener="#{pagedSort.sortActionListener}" sortColumn="#{pagedSort.sort}"
sortColumnAscending="#{pagedSort.ascending}" >
What happens now is that the super.broadcast() method calls the sortActionListener() method
before the properties sort  / ascending of the handler are set to their new values. So I´m
actually sorting on the old values.

This would be fixed if super.broadcast(event) is called after the values of the datatable
have been updated.


> <t:commandSortHeader> processes action / actionListener before updating values
of sortColumn and sortAscending
> --------------------------------------------------------------------------------------------------------------
>
>          Key: MYFACES-562
>          URL: http://issues.apache.org/jira/browse/MYFACES-562
>      Project: MyFaces
>         Type: Bug
>   Components: Tomahawk
>     Versions: 1.0.10m10
>     Reporter: Erik-Berndt Scheper

>
> At the moment <t:CommandSortHeader> processes an action / actionListener before
updating the values of sortColumn and sortAscending. The reason is that in the broadcast()
 method of HtmlCommandSortHeader.java, the method super.broadcast(event) is executed before
the values are updated.
> The consequence of this bug is that in the methods called by the action / actionListener,
the sortColumn and sortAscending properties of the datatable still have the old value. Which
in turn means that any sorting performed in the action / actionListener methods lead to incorrect
results.
> Suggested solution: call super.broadcast(event) AFTER the values of the datatable have
been updated.

-- 
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


Mime
View raw message