users@woodstock.java.net

Re: TableColumn sorting

From: Jscud <y.gillet_at_gmail.com>
Date: Tue, 13 May 2008 17:17:48 -0700 (PDT)

thank you for this information.
then, how could i sort my tablecolumn on list size (too bad i cant use
#{myList.size} in EL btw) ?
Regards
Yves.


Dan Labrecque wrote:
>
> The JSP Standard Tag Library (JSTL) |length| tag might be useful, but
> there are interoperability issues with JSTL and JavaServer Faces, so use
> with caution. The JSF property resolver may not be able to evaluate the
> EL expression after the JSP page has been parsed.
>
> Dan
>
> Jscud wrote:
>> 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-on-list-size-tp17159314p17220965.html
Sent from the Project Woodstock - Users mailing list archive at Nabble.com.