Finally, after 8 hours of fighting with this I found the error, but yet I
haven´t been able to understand what was happening, although everything is
working properly now (Its probably a bug but I'm not sure).
I had the following input hidden elements in the page:
<h:inputHidden id="confirmDeleteMessage" value="#{a:getText2('localmsgs',
'confirmDelete')}"/>
<h:inputHidden id="confirmRemoveMessage" value="#{a:getText2('localmsgs',
'confirmRemove')}"/>
(where getText2 is a Facelet function that I use often throughout my
application for accesing some internationalization libraries that we use
with this project)
The goal of both of these hiddens is to interact with some javascript code
that I have to show specific confirm messages prior to delete actions.
This is really strange 'cause what causes the problem is the use of the
function, a:getText2, but the text gets rendered without problem and on the
page I get the respective:
<input type="hidden" id="resultsForm:confirmDeleteMessage"
name="resultsForm:confirmDeleteMessage" value="Are you sure you want to
delete the selected element?" />
<input type="hidden" id="resultsForm:confirmRemoveMessage"
name="resultsForm:confirmRemoveMessage" value=" Are you sure you want to
remove the selected element?" />
As an experiment I included the inputHidden without a function and it works
perfectly.
<h:inputHidden id="confirmDeleteMessage" value=" Are you sure you want to
delete the selected element?"/>
<h:inputHidden id="confirmRemoveMessage" value=" Are you sure you want to
remove the selected element?"/>
ITS A STRANGE WORLD!
Regards and thanks,
JV
-----Mensaje original-----
De: Jorge Vásquez [mailto:[EMAIL PROTECTED]
Enviado el: miércoles, 01 de noviembre de 2006 12:29
Para: 'MyFaces Discussion'
Asunto: RE: Help with datatable sorting...
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