cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ugo Cei <u....@pronetics.it>
Subject Re: [cforms] creating selection list from vector
Date Tue, 05 Jul 2005 07:50:22 GMT
Il giorno 04/lug/05, alle 23:07, Thorsten Mauch ha scritto:

> I try to create a section list from a vector using the flow-jxpath
> implementation.
> I have a Vector objects with the getter for "oid" and "description". I  
> pass
> this vector
> the cforms (where getLineItems() retruns a Vector):
> form.showForm("admcategory-display.page",{"items": 
> formmodel.getLineItems()})
> ;
>
> I define the seclection list as follows:
>
>   <fd:selection-list>
>           <fd:selection-list type="flow-jxpath" list-path="items"
> value-path="oid" label-path="description" />
>       </fd:selection-list>
>
> What does i make wrong ?

Vector (besides being a "legacy" class) is not a Collection. You need  
to pass a Java2 collection to the template (i.e. a class implementing  
java.util.Collection) and not a Vector.

Apart from that, it's not advisable to use the flow-jxpath selection  
list. The recommended way is:

form.lookupWidget("field-id").setSelectionList(items, "oid",  
"description");

You also seem to have an fd:selection-list element inside another  
fd:selection-list element, which does not make sense.

	Ugo

-- 
Ugo Cei
Tech Blog: http://agylen.com/
Open Source Zone: http://oszone.org/
Wine & Food Blog: http://www.divinocibo.it/


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message