-
1. Re: a4j:datatable
sergeysmirnov Mar 26, 2007 1:01 PM (in response to gajananmore)Ajax4jsf (a4j) has no dataTable component . Probably, you speak about the RichFaces dataTable.
Event it is so, I still do not understand the question. -
2. Re: a4j:datatable
gajananmore Mar 27, 2007 12:25 AM (in response to gajananmore)i know its rich faces component
if i want to sort the whole table on the basis of some sequence
that facility i want -
3. Re: a4j:datatable
ilya_shaikovsky Mar 27, 2007 5:44 AM (in response to gajananmore)Just right now you may only organize Ajax sorting just via a4j:command* components in headers for example. Or use tomahawk ones with ajax-ed a4j:form as shown in examples.
Sort components for our rich table - is in our roadmap. -
4. Re: a4j:datatable
sergeysmirnov Mar 27, 2007 5:51 PM (in response to gajananmore)The request for enhancement has been registered in jira.
http://jira.jboss.com/jira/browse/RF-6
Just vote for it if you like this feature to be out-of-the-box for datatable.. -
5. Re: a4j:datatable
gajananmore Apr 9, 2007 1:36 AM (in response to gajananmore)in ur Ajax4jsf forum u sended me reply thanks for that
but i am not getting how i can use Command Button for sorting in dataTable if u have any example
plz forward that example to me -
6. Re: a4j:datatable
ilya_shaikovsky Apr 9, 2007 7:42 AM (in response to gajananmore)the simple example:
<rich:dataTable value="#{capitalsBean.capitals}" var="cap" id="table"> <rich:column> <f:facet name="header"> <a4j:commandLink value="name" action="#{capitalsBean.namesSort}" reRender="table"/> </f:facet> <h:outputText value="#{cap.name}"></h:outputText> </rich:column> <rich:column> <f:facet name="header"> <a4j:commandLink value="state" action="#{capitalsBean.statesSort}" reRender="table"/> </f:facet> <h:outputText value="#{cap.state}"></h:outputText> </rich:column> </rich:dataTable>
public String namesSort() { Collections.sort(capitals, new Comparator<Capital> () { public int compare(Capital capital, Capital capital2) { return capital.getName().compareTo(capital2.getName()); } }); return null; } public String statesSort() { Collections.sort(capitals, new Comparator<Capital> () { public int compare(Capital capital, Capital capital2) { return capital.getState().compareTo(capital2.getState()); } }); return null; }