[
https://jira.jboss.org/jira/browse/RF-8469?page=com.atlassian.jira.plugin...
]
Nick Belaevski commented on RF-8469:
------------------------------------
From the Leonid's letter:
"Nick,
I looked to your suggestion and am a bit confused. You say:
Unfortunately, support for "rowKeyVar" in sorting/filtering expressions is not
implemented. I've created task to describe this in docs.
You can use the following workaround (requires that StatisticsValues class has some kind
of ID):
1) make prodBenchNames property a dictionary mapping id to StatisticsValues#getProduct()
object
2) Rewrite sort expression as
#{piQueryToolOutputBeanPR.statOutData.prodBenchNames[curPortBench.id]}
But prodBenchNames is a vector and hence can't be addressed via the key. That's
why I tried to use rowKeyVar as an iterator.
You can't know the index value in StatisticValues class, because the only class that
knows about prodBenchNames is StatisticOutputData.
I tried using curPortBench.product value as sortBy and it still doesn't work, but it
works as value (see code snippet below):
<rich:dataTable
value="#{piQueryToolOutputBeanPR.statOutData.statVals}"
rowKeyVar="rKV"
var="curPortBench" rendered="#{not empty
piQueryToolOutputBeanPR.statOutData.statistics}">
...
<rich:column id="portBenchName"
sortBy="#{curPortBench.product}">
<f:facet name="header">
</f:facet>
<!-- h:outputText
value="#{piQueryToolOutputBeanPR.statOutData.prodBenchNames[rKV]}"/-->
<h:outputText value="#{curPortBench.product}"/>
</rich:column>
It throws the same exception (FOREACH_BAD_ITEMS).
I am not sure why it happens though, because code seems to be similar to the example you
provide at
http://docs.jboss.org/richfaces/3.3.2.GA/en/devguide/html/rich_column.htm...
Could you explain?
BTW, is sorting supposed to work only in 3.3.2.CR1 or in 3.3.1.GA as well? "
Sorting of rich:dataTable is still not working in 3.3.2.SR1
------------------------------------------------------------
Key: RF-8469
URL:
https://jira.jboss.org/jira/browse/RF-8469
Project: RichFaces
Issue Type: Bug
Security Level: Public(Everyone can see)
Affects Versions: 3.3.2.SR1
Environment: Windows, JBoss 4.2.2.GA
Reporter: Leonid Sokolin
Assignee: Nick Belaevski
Attachments: piQueryToolOutputPR.xhtml, piQueryToolOutputPR.xhtml,
QueryToolOutputBean.java, StatisticsOutputData.java, StatisticsValues.java
Sorting doesn't work on the value, which is shown correctly in the column.
I could see values and sorting arrows in the header, but when I click on them, it throws
exeception:
21:15:38,875 ERROR [ColumnsHandler] FOREACH_BAD_ITEMS
javax.servlet.jsp.JspTagException: FOREACH_BAD_ITEMS
at
org.richfaces.iterator.SimpleForEachIterator.toForEachIterator(SimpleForEachIterator.java:135)
at
org.richfaces.iterator.SimpleForEachIterator.supportedTypeForEachIterator(SimpleForEachIterator.java:98)
at org.richfaces.taglib.ColumnsHandler.prepare(ColumnsHandler.java:304)
at org.richfaces.taglib.ColumnsHandler.apply(ColumnsHandler.java:489)
at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
at
com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
...
Code is as follows:
<rich:column id="portBenchName"
sortBy="#{piQueryToolOutputBeanPR.statOutData.prodBenchNames[rKV]}">
<f:facet name="header">
</f:facet>
<h:outputText
value="#{piQueryToolOutputBeanPR.statOutData.prodBenchNames[rKV]}"/>
</rich:column>
It looks like it couldn't use the value that I put in sortBy.
Please advise.
Leonid
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira