cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johannes Textor <>
Subject Re: Styling an fd:multivaluefield item?
Date Fri, 08 Jun 2007 07:09:52 GMT

I think Joerg is making the following point: In the form *definition*, 
you just define the set of *possible* values for a field, e.g.:

     <fd:multivaluefield id="language">
        <fd:label>Select language</fd:label>
        <fd:datatype base="integer"/>
            <fd:item value="1"><fd:label>english</fd:label></fd:item>
            <fd:item value="2"><fd:label>german</fd:label></fd:item>
            <fd:item value="3"><fd:label>french</fd:label></fd:item>

Then which fields are actually selected depends on the object you're 
editing, i.e., must be set in the form's *model*. In flowscript:

var form = new Form("formdef.xml");
var model = form.getModel();

model.languages[0] = 1;
model.languages[1] = 3;


This will yield the following form *instance*:

<fi:multivaluefield id="language">
<fi:label>Select language</fi:label>
            <fi:item value="1"><fi:label>english</fi:label></fi:item>
            <fi:item value="2"><fi:label>german</fi:label></fi:item>
            <fi:item value="3"><fi:label>french</fi:label></fi:item>

So there is no need for a "selected="true"" or similar attribute on the 
items of the selection list.


Derek Hohls wrote:
> Joerg
> Sorry, what you are saying is very unclear to me... I have given
> code examples of what I want to achieve - if you could show me
> code examples of how to do this, then understanding would be
> achieved!
> (I have tried to explain again in another post what it is I am
> trying to get to.)
> Derek

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message