-
1. Re: rich:datatable and sorting (data table) HELP!
nbelaevski Aug 25, 2009 6:09 AM (in response to jonhsmith)Hi,
Try adding "header" facets to columns. -
2. Re: rich:datatable and sorting (data table) HELP!
jonhsmith Aug 25, 2009 7:25 AM (in response to jonhsmith)nbelaevski, can show me an example? Where I have to add header?
-
4. Re: rich:datatable and sorting (data table) HELP!
jonhsmith Aug 25, 2009 8:15 AM (in response to jonhsmith)I saw http://livedemo.exadel.com/richfaces-demo/richfaces/sortingFeature.jsf
But my problem is add the column3 wich is divided into three subcolums
column1 (with sorting) | column2 (with sorting)| column3 (without sorting)|
value1 | value2 | s1 | s2 | s3 |
value1 | value2 | s1 | s2 | s3 |
value1 | value2 | s1 | s2 | s3 |
value1 | value2 | s1 | s2 | s3 |
value1 | value2 | s1 | s2 | s3 |
value1 | value2 | s1 | s2 | s3 | -
5. Re: rich:datatable and sorting (data table) HELP!
ilya_shaikovsky Aug 25, 2009 8:31 AM (in response to jonhsmith)Still can't see the problem . You defining the header and sortBy both for columns which should be sorted and defining just header (with just label) without sortBy for the columns which should not be sorted.
-
6. Re: rich:datatable and sorting (data table) HELP!
bm97 Aug 25, 2009 8:33 AM (in response to jonhsmith)I am not sure, but:
To support column grouping and sorting at the same time, you have to use both "header"-facets.
For each <rich:column> AND the "header"-facet of the <rich:datatable>. -
7. Re: rich:datatable and sorting (data table) HELP!
jonhsmith Aug 25, 2009 8:40 AM (in response to jonhsmith)bm97, Can you show me a simple example?
thanks -
8. Re: rich:datatable and sorting (data table) HELP!
bm97 Aug 25, 2009 9:30 AM (in response to jonhsmith)Here a sample, it should work.
You also forgot the value-binding/EL-expressions. Else the sortBy-attribute does not know what data to sort. Greetings<rich:dataTable id="table" var="record" value="#{tableBean.values}" rows="10" width="100%"> <f:facet name="header"> <rich:columnGroup> <rich:column> <h:outputText value="Column1" /> </rich:column> <rich:column> <h:outputText value="Column2" /> </rich:column> <rich:column colspan="3"> <h:outputText value="Column3" /> </rich:column> </rich:columnGroup> </f:facet> <rich:column sortBy="#{record.value1}"> <f:facet name="header">record.value1</f:facet> <h:outputText value="#{record.value1}" /> </rich:column> <rich:column sortBy="#{record.value2}"> <f:facet name="header">record.value2</f:facet> <h:outputText value="#{record.value2}" /> </rich:column> <rich:column> <f:facet name="header">record.s1</f:facet> <h:outputText value="#{record.s1}" /> </rich:column> <rich:column> <f:facet name="header">record.s2</f:facet> <h:outputText value="#{record.s2}" /> </rich:column> <rich:column> <f:facet name="header">record.s3</f:facet> <h:outputText value="#{record.s3}" /> </rich:column> </rich:dataTable>
-
9. Re: rich:datatable and sorting (data table) HELP!
jonhsmith Aug 25, 2009 9:55 AM (in response to jonhsmith)It works, but the sorting icons appear next to recor.value1 and my requirement is that the icons appear next to the column1 and column2 (on the title)
Column1 (iconst to sorting) | Column2 (iconst to sorting) | -
10. Re: rich:datatable and sorting (data table) HELP!
bm97 Aug 25, 2009 10:15 AM (in response to jonhsmith)You cannot have anything like
|column1 (with sorting) | column2 (with sorting)| column3 (without sorting)| |--------------------------------------------------------------------------| |value1 | value2 | s1 | s2 | s3 | |value1 | value2 | s1 | s2 | s3 |
but you can have something like the following| | merged column label | |column1 (with sorting) | column2 (with sorting)| label |label |label | |--------------------------------------------------------------------------| |value1 | value2 | s1 | s2 | s3 | |value1 | value2 | s1 | s2 | s3 |
<rich:dataTable id="table" var="record" value="#{tableBean.values}" rows="10" width="100%"> <f:facet name="header"> <rich:columnGroup> <rich:column colspan="2"> <!-- empty column --> <h:outputText value="" /> </rich:column> <rich:column colspan="3"> <h:outputText value="Combined label" /> </rich:column> </rich:columnGroup> </f:facet> <rich:column sortBy="#{record.value1}"> <f:facet name="header">Column1</f:facet> <h:outputText value="#{record.value1}" /> </rich:column> <rich:column sortBy="#{record.value2}"> <f:facet name="header">Column2</f:facet> <h:outputText value="#{record.value2}" /> </rich:column> <rich:column colspan="1"> <f:facet name="header">record.s1</f:facet> <h:outputText value="#{record.s1}" /> </rich:column> <rich:column> <f:facet name="header">record.s2</f:facet> <h:outputText value="#{record.s2}" /> </rich:column> <rich:column> <f:facet name="header">record.s3</f:facet> <h:outputText value="#{record.s3}" /> </rich:column> </rich:dataTable>
@Nick/ilya: Perhaps you can provide this code as sample code for the documentation/wiki?! -
11. Re: rich:datatable and sorting (data table) HELP!
jonhsmith Aug 25, 2009 10:30 AM (in response to jonhsmith)Someone know how to do that?
Thanks -
12. Re: rich:datatable and sorting (data table) HELP!
jonhsmith Aug 25, 2009 10:40 AM (in response to jonhsmith)thanks bm97 I think that will help me
-
13. Re: rich:datatable and sorting (data table) HELP!
ilya_shaikovsky Aug 25, 2009 11:27 AM (in response to jonhsmith)seems in your case you should implement external sorting by using sortOrder's bindings and links to change its states defined in header where you need.
-
14. Re: rich:datatable and sorting (data table) HELP!
ilya_shaikovsky Aug 25, 2009 11:29 AM (in response to jonhsmith)if the solution of bm97 will not fit your needs.