Thanks Simon,
This problem is really driving me crazy, I have compared everything with the
myfaces examples and with what you mention in the link and I am doing what
is suggested.
Here is part of my xhtml code:
<t:dataTable id="resultsData"
headerClass="searchResultHeaders"
rowClasses="searchResult1,searchResult2"
var="row"
value="#{searchResultsBean.rowData}"
sortColumn="#{searchResultsBean.sort}"
sortAscending="#{searchResultsBean.ascending}" preserveSort="true"
rows="10"
width="100%"
cellspacing="0"
cellpadding="0"
border="0">
<t:columns id="columns"
value="#{searchResultsBean.columnHeaders}" var="columnHeader">
<f:facet name="header">
<h:panelGroup>
<t:commandSortHeader
columnName="#{columnHeader.label}"
arrow="false" styleClass="searchResultHeaders"
rendered="#{columnHeader.clickable}">
<f:facet
name="ascending">
<t:graphicImage value="/pages/images/arrows_orderby_asc.gif"
rendered="true" border="0" />
</f:facet>
<f:facet
name="descending">
<t:graphicImage value="/pages/images/arrows_orderby_desc.gif"
rendered="true" border="0" />
</f:facet>
<h:outputText value="#{columnHeader.label}"/>
</t:commandSortHeader>
<h:outputText
value="#{columnHeader.label}" rendered="#{!columnHeader.clickable}" />
</h:panelGroup>
</f:facet>
..........................
My Bean is extending from SortableList as the examples do, etc. The very
strange thing here is that it was working a couple days ago perfectly and I
did a couple of changes and its not working anymore (The worst of all is
that it isn´t under Version Control so I don´t have the previous working
version). I am comparing one table that works perfectly with this one and I
have found that in the one that works perfect the InvokeApplication phase
always gets executed meanwhile in the one that has problems this phase is
getting skipped. Also, in the bad one the column name that I get is always
empty ("") meanwhile in the other one it is the respective column name.
Simon, any insights either to the problem or to how to diagnose it better
would be deeply appreciated.
Thanks and Regards,
JV
-----Mensaje original-----
De: Simon Kitching [mailto:[EMAIL PROTECTED]
Enviado el: martes, 31 de octubre de 2006 21:59
Para: MyFaces Discussion
Asunto: Re: Help with datatable sorting...
Simon Kitching wrote:
> Hi Jorge,
>
> Jorge Vásquez wrote:
>>
>> Regards to all,
>>
>> One week ago I had my commandSortHeader working perfectly until all
>> of a sudden it just stopped ordering. I haven´t done any change
>> neither to the xhtml page nor to the bean, and I am really having a
>> tough time trying to decipher how is this component´s operation in
>> order to proceed with some debugging. This whole ordering stuff is
>> really sui-generis, cause it seems to work without the
>> conventional action paradigm or at least I dont see nowhere where
>> the action invocation takes place. My specific problem is that I am
>> not receiving on the bean the column name clicked by the user. In
>> summary I have 2 questions that can really help me solve this issue:
>>
>> 1. Why can´t the column be arriving at the sort function of the
>> bean? (This is probably too difficult to answer as it implies
>> multiple possibilities)
>> 2. Can anyone explain me the basic operating mechanism used by the
>> commandSortHeader component or redirect me to somewhere where it
>> is explained?
>>
> Are you aware of the myfaces wiki?
> http://wiki.apache.org/myfaces
>
> This page in particular may be useful:
> http://wiki.apache.org/myfaces/Working_with_auto_sortable_tables
Hmm..actually, after reading that Working_with_auto_sortable_tables
page, I'm not sure that first example is correct. I could be wrong, as
it's a while since I last wrote a sortable table but I don't remember
anything that automatally invokes a method with signature
public String sort(String column)
Here's a link to an earlier email discussion on table sorting that may
be useful:
http://mail-archives.apache.org/mod_mbox/myfaces-users/200601.mbox/%3C001501
[EMAIL PROTECTED]
Regards,
Simon