You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Thorsten Mauch <ma...@imkenberg.de> on 2005/07/04 23:07:54 UTC
[cforms] creating selection list from vector
Hi
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 ?
Thanx a lot for any help
Thorsten
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: [cforms] creating selection list from vector
Posted by Ugo Cei <u....@pronetics.it>.
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