« Return to Thread: TableColumn sorting on list size

TableColumn sorting on list size

by Jscud :: Rate this Message:

Reply to Author | View in Thread

Hi,

i'm trying to sort a tablecolumn which displays the number of elements of a java.util.List
I've done this (using Netbeans VWP 6.1 and glassfish 2ur2 btw):

<jsp:root version="2.1" ...xmlns:fn="http://java.sun.com/jsp/jstl/functions"> //Added this part to the VWP generated stuff

...
<webuijsf:tableRowGroup id="tableRowGroup1" rows="20"
                                sourceData="#{IlesControleur.iles}" sourceVar="currentRow">
                               
                                <webuijsf:tableColumn headerText="Communes" id="tableColumn7" sort="#{fn:length(currentRow.value['communes'])}" descending="true">
                                    <webuijsf:staticText id="staticText1" text="#{fn:length(currentRow.value['communes'])}"/>
                                </webuijsf:tableColumn>


#{IlesControleur.iles} returns a List of POJOs Ile which contains the property communes as a List too.
When I sort the column the first time, all is going well (getting the communes size descending), but the second time i sort I got an exception:
javax.el.ELException: Function 'fn:length' not found
        at com.sun.el.lang.ExpressionBuilder.visit(ExpressionBuilder.java:213)
        at com.sun.el.parser.SimpleNode.accept(SimpleNode.java:162)
        at com.sun.el.lang.ExpressionBuilder.prepare(ExpressionBuilder.java:178)
        at com.sun.el.lang.ExpressionBuilder.build(ExpressionBuilder.java:189)
        at com.sun.el.lang.ExpressionBuilder.createValueExpression(ExpressionBuilder.java:232)
        at com.sun.el.ExpressionFactoryImpl.createValueExpression(ExpressionFactoryImpl.java:92)
        at com.sun.webui.jsf.faces.ValueBindingSortCriteria.readObject(ValueBindingSortCriteria.java:220)

If it says it doesnt find the 'fn:length' jstl function, it shouldn't work at all.
Any idea on this?
Thanks in advance

 « Return to Thread: TableColumn sorting on list size

LightInTheBox - Buy quality products at wholesale price!