-
1. Re: Making a table sortable.
dmitry.demyankov Nov 15, 2007 4:01 AM (in response to cbrands)Nope, sortable="true" doesn't work in dataTable. You should implement your own sort methods..
-
2. Re: Making a table sortable.
tjakopec Nov 15, 2007 4:34 AM (in response to cbrands)But, it will work in 3.2.0?
-
3. Re: Making a table sortable.
cbrands Nov 15, 2007 4:38 AM (in response to cbrands)Thanks dmitry,
Making sort methods is no problem. But how can I make rich:dataTable run them when They have to? There is a onRowClick attribute but unfortunally no onColumnClick attribute :-( -
4. Re: Making a table sortable.
dmitry.demyankov Nov 15, 2007 4:57 AM (in response to cbrands)2 tjakopec
It's in the road map for 3.2.0 but will it be implemented or not is a question to developers :)
2 cbrands
I just made headers in columns as a4j:commandLink and sort column when it is clicked. -
5. Re: Making a table sortable.
cbrands Nov 15, 2007 5:25 AM (in response to cbrands)dmitry
You mean something like this?
<rich:dataTable id="mytable">
<rich:column>
<a4j:commandLink reRender="mytable"
action="mybean.mySortMethod">
<h:outputText value="columnA></h:outputText>
</rich:column>
<rich:column>
<h:outputText value="columnB></h:outputText>
</rich:column>
</rich:dataTable>
sorry to ask so many questions I am new to richfaces.
thanks for your help -
6. Re: Making a table sortable.
dmitry.demyankov Nov 15, 2007 5:33 AM (in response to cbrands)I mean something like this
<rich:column> <f:facet name="header"> <a4j:commandLink value="column 1" action="#{bean.sortMethod}" reRender="myTable"/> </f:facet> <h:outputText value="#{item}"> </rich:column>
You can also add a4j:actionparam to commandLink pass some parameters.
Hope it helps :) -
7. Re: Making a table sortable.
cbrands Nov 15, 2007 5:38 AM (in response to cbrands)I understand.
Thank you for all your help. -
8. Re: Making a table sortable.
tjakopec Nov 16, 2007 1:39 AM (in response to cbrands)"dmitry.demyankov" wrote:
I mean something like this<rich:column> <f:facet name="header"> <a4j:commandLink value="column 1" action="#{bean.sortMethod}" reRender="myTable"/> </f:facet> <h:outputText value="#{item}"> </rich:column>
You can also add a4j:actionparam to commandLink pass some parameters.
Hope it helps :)
I now how to implemented sortable and I said its not hard, but that OK if you have one or two datatable with the simple entity (3-4 attributes). We would like to get generic sortable because we have lots of datatables and in each one off them we show entity.entity.entity.attribute. Two months ago there was discussion on subject and conclusion was that is not so hard to implement generic sortable but its only a question will developers wanna implement generic sortable in datatable because they already did in r:scrollableDataTable. -
9. Re: Making a table sortable.
dmitry.demyankov Nov 16, 2007 1:49 AM (in response to cbrands)Well, in that case you should wait until 3.2.0 release - there's a sortable dataTable in road map for that release.. otherwise you probably should write your own implementation of dataTable..
-
10. Re: Making a table sortable.
tjakopec Nov 16, 2007 2:17 AM (in response to cbrands)"dmitry.demyankov" wrote:
Well, in that case you should wait until 3.2.0 release - there's a sortable dataTable in road map for that release.. otherwise you probably should write your own implementation of dataTable..
Its OK, I am waiting for 3.2.0., I trying to build it manually but currently there are two thing that i not finished
1. http://jira.jboss.com/jira/browse/RF-1340
2. build failed on Skins part... -
11. Re: Making a table sortable.
dmitry.demyankov Nov 16, 2007 2:23 AM (in response to cbrands)I haven't tried working 3.2.0 release. I usually stick to latest stable version.
-
12. Re: Making a table sortable.
tjakopec Nov 16, 2007 2:32 AM (in response to cbrands)"dmitry.demyankov" wrote:
I haven't tried working 3.2.0 release. I usually stick to latest stable version.
Agree, we also working with 3.1.3, but every night I build 3.2.0 hoping to work and get sortable on datatable :) -
13. Re: Making a table sortable.
dmitry.demyankov Nov 16, 2007 2:38 AM (in response to cbrands)I see, good luck then :)