-
1. Re: <rich:columns id="#{index}" problem
eugenbesel Feb 6, 2010 5:31 AM (in response to eugenbesel)so, now I use facelets and made xhtml files from my jsp.
now I can use id="#{index}", but this point hasn't resolved my issue.
I still can not sort the table and if I try to filter the data I ge the following message:
java.lang.NoClassDefFoundError: org/apache/commons/collections/iterators/IteratorChain
org.richfaces.component.UIExtendedDataTable.fixedChildren(UIExtendedDataTable.java:397)
org.ajax4jsf.component.UIDataAdaptor.iterate(UIDataAdaptor.java:1019)
org.ajax4jsf.component.UIDataAdaptor.processDecodes(UIDataAdaptor.java:1140)
org.ajax4jsf.component.UIDataAdaptor.processDecodes(UIDataAdaptor.java:1150)
org.ajax4jsf.component.AjaxViewRoot$1.invokeContextCallback(AjaxViewRoot.java:395)
org.ajax4
does anybody know how can I resolve my problem???
thank you -
2. Re: <rich:columns id="#{index}" problem
eugenbesel Feb 6, 2010 2:53 PM (in response to eugenbesel)so I found I get the message about IteratorChain.
I downloaded the needed jar file.
I changed my table from columns to column. the filtering of the table work now. But if make columns again it doesnt work. I tip a letter into filter field, the table is rerenderd but nothing happend.
the problem with sorting still occurs. If I cklick on the column to sort it, the data disappears and I can only see the waitsymbol.
my last version of xhtml file is like:
<rich:extendedDataTable value="#{searchModul.columnData}" var="data" width="500px" height="600px" sortMode="single" selectionMode="multi">
<f:facet name="header">
<h:outputText value="#{searchModul.tableHeader}"></h:outputText>
</f:facet>
<rich:columns id="col_#{col}" value="#{searchModul.columns}" var="col" index="ind" filterBy="#{data[ind]}" sortBy="#{data[ind]}" sortOrder="#{searchModul.sortOrder}" filterEvent="onkeyup">
<f:facet name="header">
<h:outputText value="#{col}"/>
</f:facet>
<h:outputText value="#{data[ind]}"></h:outputText>
</rich:columns>
</rich:extendedDataTable>Java:
public Map<String, Object> getSortOrder() {
for(ColumnConfigurationVO columnsIter : confVO.getColumns()){
sortOrder.put(columnsIter.getCaption(),Ordering.UNSORTED);
}
return sortOrder;
}private List<ArrayList<String>> datamap = new ArrayList<ArrayList<String>>();
/**
* this method create the data values for displaing n GUI
* @return
*/
public List<ArrayList<String>> getColumnData(){
return datamap;
}What have I done wrong?????????
thank you
-
3. Re: <rich:columns id="#{index}" problem
ilya_shaikovsky Feb 8, 2010 7:59 AM (in response to eugenbesel)please follow my suggestion at http://community.jboss.org/message/524732#524732
Also in order to store current state of sorting/filtering with columns - you should map the sortOrder and filterValue to bean properties as it done at demo.
-
4. Re: <rich:columns id="#{index}" problem
eugenbesel Feb 9, 2010 3:08 AM (in response to ilya_shaikovsky)hello Ilja,
thank you for your answer.
how should I write the setter methods for SortOrder:
my getter looks like:
public Map<String, Object> getSortOrder() {
return sortOrder;
}If I try with this setter-method and debug the application then it doesnt go in in this method.
public void setSortOrder(SortOrder sortOrder1){
System.out.print("");
}or should it looks like this?
public void setSortOrder(Map<String, Object> map){
sortOrder = map;
}the application doesnt go in this methods, thats why my sortOrder object has always the unsorted value.
-
5. Re: <rich:columns id="#{index}" problem
ilya_shaikovsky Feb 9, 2010 4:41 AM (in response to eugenbesel)used there
http://livedemo.exadel.com/richfaces-demo/richfaces/columns.jsf
and there
full samples including all Java sources available in SVN
-
6. Re: <rich:columns id="#{index}" problem
eugenbesel Feb 9, 2010 2:17 PM (in response to ilya_shaikovsky)hello Ilja,
thank you for the links.
In demo example from Nick Belaevski he used BaseModifiableHibernateDataModel which he set in <rich:dataTable value="#{hibernateDataModel}"
is it necessary to use DataModel or I can also set a ArrayList to <rich:dataTable value="?"
in my case, I took the DatatableStateHolder from Nick and bind it to my xhtml.
I debugged into the workflow and could see, that sortOrder object contains my chose, but the dataTable on xhtml isn't updated.
As I can see, I dont need to rerender the table with ajax. It should happen automaticly, isn't it??
The filter function works now, but if I enter some letter into filter all of data disappear from the table.Should I implement the filter method by myself?
here is my code.
<rich:dataTable value="#{searchModul.columnData}" var="data"
width="300px" height="300px" sortMode="single" selectionMode="multi">
<f:facet name="header">
<h:outputText value="#{searchModul.tableHeader}"></h:outputText>
</f:facet>
<rich:columns id="col_#{col}" value="#{searchModul.columns}"
var="col" index="ind"
filterBy="#{col}" filterEvent="onkeyup" sortBy="#{col}"
sortOrder="#{dataTableStateHolder.sortOrders[col]}"
filterValue="#{dataTableStateHolder.columnFilterValues[col]}">
<f:facet name="header">
<h:outputText value="#{col}"/>
</f:facet>
<h:outputText value="#{data[ind]}"></h:outputText>
</rich:columns>
</rich:dataTable>Java:
-
7. Re: <rich:columns id="#{index}" problem
eugenbesel Feb 9, 2010 2:47 PM (in response to eugenbesel)hello Ilja,
I found the solution of my issue.Now I can filter and sort of my data.
do you know if it is possible to make a groupBy if I make a dynamic columns??
thank you for your answer.
-
8. Re: <rich:columns id="#{index}" problem
ilya_shaikovsky Feb 10, 2010 7:26 AM (in response to eugenbesel)group by currently works according to sortBy definitions. So it should already works if sorting works. -
9. Re: <rich:columns id="#{index}" problem
eugenbesel Feb 12, 2010 7:46 AM (in response to ilya_shaikovsky)tags "column" and "columns" don't contain groupBy attribute.
http://livedemo.exadel.com/richfaces-demo/richfaces/columns.jsf?tab=info&cid=4152767
just ExtendeDataTable contains attribute groupByColumn, which need an id of the column. In my case the columns are generated, So I dont have any id of the column.
any ideas??
thank you.
-
10. Re: <rich:columns id="#{index}" problem
eugenbesel Feb 13, 2010 2:10 PM (in response to eugenbesel)hello Ilja,
you are right. If I use extendedDatatable, then can group my Data on UI. (not with <rich:dataTable ...
If I group data by one column and sort this data by other column, then the groupByColumn is desappeard.
is this a bug from Richfaces, or I've done something wrong???
wbr
Eugen
-
11. Re: <rich:columns id="#{index}" problem
eugenbesel Feb 14, 2010 3:13 AM (in response to eugenbesel)I found my error. I set tableState attribute for my table.
thank you for your help.