You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by tedwards <te...@civica.com.au> on 2006/06/22 03:49:10 UTC
Selected values in multiselect field
Hi people,
I have a situation where I can display a list of options in a list box
with the data for the list being supplied from an XSP.
eg:
<fd:multivaluefield id="roles">
<fd:label>Edit the roles assigned to the group:</fd:label>
<fd:datatype base="long"/>
<fd:selection-list src="cocoon:/resources/getRoleList.xsp"
dynamic="true"/>
</fd:multivaluefield>
I then supply a list of *already* selected items by passing in an array
to the form widget:
var roleArray = Array();
for(var i=0; i < roleList.length; i++){
roleArray[i] = new java.lang.Long(roleVal);
}
//Assign this array to the role drop down list
model.roles = roleArray;
The widget 'roles' already has the list populated by the xsp.
The previously selected values come from the array, and some magic takes
place behind the scenes where the intersection of both lists results in
the listitem being set to 'selected'.
I've tried to replicate this using a list supplied by flow-jxpath but I
can't seem to get it right.
Has anyone got a process in place where you can display a bunch of
selected items in a multi-select field without resorting to XSP?
Thanks for your time,
Tony
--
This email is from Civica Pty Limited and it, together with
any attachments, is confidential to the intended recipient(s)
and the contents may be legally privileged or contain
proprietary and private information. It is intended solely
for the person to whom it is addressed. If you are not an
intended recipient, you may not review, copy or distribute
this email. If received in error, please notify the sender
and delete the message from your system immediately. Any
views or opinions expressed in this email and any files
transmitted with it are those of the author only and may
not necessarily reflect the views of Civica and do not create
any legally binding rights or obligations whatsoever. Unless
otherwise pre-agreed by exchange of hard copy documents
signed by duly authorised representatives, contracts may not
be concluded on behalf of Civica by email. Please note that
neither Civica nor the sender accepts any responsibility for
any viruses and it is your responsibility to scan the email
and the attachments (if any). All email received and sent by
Civica may be monitored to protect the business interests of
Civica.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org