2005/5/22, Sebastien Arbogast <[EMAIL PROTECTED]>:
> I should... and I did but it doesn't work as expected.
> Here is my flowscript method :
>
> function createUser(){
> getSchaman();
> var form = new Form("forms/create_user_d.xml");
> var user;
> var model;
>
> var roles = schaman.getAllRoles();
> form.lookupWidget("userRoles").setSelectionList(roles,"name","name");
>
> form.showForm("internal/display-user-creation-form");
> model = form.getModel();
> user = schaman.createUser(
> model.userName,
> DigestUtils.md5Hex(model.password),
> model.userActive,
> model.userEmail,
> model.userRoles
> );
>
> cocoon.sendPage("users-list");
> }
>
> And the corresponding form definition :
>
> <fd:form id="data"
> xmlns:fd="http://apache.org/cocoon/forms/1.0#definition"
> xmlns:i18n="http://apache.org/cocoon/i18n/2.1">
> <fd:widgets>
> <fd:booleanfield id="userActive">
> <fd:label>
> <i18n:text key="user-active"/>
> </fd:label>
> </fd:booleanfield>
> <fd:field id="userName" required="true">
> <fd:label>
> <i18n:text key="user-name"/>
> </fd:label>
> <fd:datatype base="string"/>
> </fd:field>
> <fd:field id="userEmail" required="true">
> <fd:datatype base="string">
> <fd:validation>
> <fd:email/>
> </fd:validation>
> </fd:datatype>
> <fd:label>
> <i18n:text key="user-email"/>
> </fd:label>
> </fd:field>
> <fd:field id="userPassword" required="true">
> <fd:label>
> <i18n:text key="user-password"/>
> </fd:label>
> <fd:datatype base="string"/>
> <fd:validation>
> <fd:length min="5" max="20"/>
> </fd:validation>
> </fd:field>
> <fd:field id="confirmPassword" required="true">
> <fd:label>
> <i18n:text key="confirm-password"/>
> </fd:label>
> <fd:datatype base="string"/>
> <fd:validation>
> <fd:assert test="userPassword = confirmPassword">
> <fd:failmessage>
> <i18n:message key="different-passwords"/>
> </fd:failmessage>
> </fd:assert>
> </fd:validation>
> </fd:field>
> <fd:multivaluefield id="userRoles">
> <fd:label><i18n:text key="user-roles"/></fd:label>
> <fd:datatype base="string"/>
> <fd:selection-list/>
> </fd:multivaluefield>
> </fd:widgets>
> </fd:form>
>
> But when I do this I get the following exception :
>
> Cannot convert [EMAIL PROTECTED]
> to java.lang.String[]
>
> Any idea ?
>
> --
> Sebastien ARBOGAST
>
Please help ! I tried to find a solution in samples but the only
multivaluefield I found was not used from flowscript. The whole form
is just forwarded to some XSP logicsheet as a request parameter.
--
Sebastien ARBOGAST
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]