users@woodstock.java.net

TableColumn sorting

From: Jscud <y.gillet_at_gmail.com>
Date: Fri, 9 May 2008 19:19:30 -0700 (PDT)

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


-- 
View this message in context: http://www.nabble.com/TableColumn-sorting-tp17159314p17159314.html
Sent from the Project Woodstock - Users mailing list archive at Nabble.com.