Johannes
 
Thanks; that is clearer.  Am I correct in assuming that the :
    <fi:values>
       <fi:value>1</fi:value>
       <fi:value>3</fi:value>
    </fi:values>
will be displayed as "checked input boxes" with a:
  <fi:styling list-type="checkbox"/>
 
I still do not understand the rationale for this; this approach
effectively means two sets of calls to the database to generate the
output (1) to create the *possible* values as fd:item, and (2) to
create the values which appear as fi:item.  While doing the first
is straightforward, doing the second will mean placing another 
database call inside of the flowscript, yes?
 
Thanks again for the clear code explanation!  An example like this in
the docs would be great.
 
Derek

>>> Johannes Textor <[EMAIL PROTECTED]> 2007/06/08 09:09 AM >>>

Derek,

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:selection-list>
            <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>
        </fd:selection-list>
     </fd:multivaluefield>

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;

form.showForm("my-form");

This will yield the following form *instance*:

<fi:multivaluefield id="language">
<fi:label>Select language</fi:label>
    <fi:values>
       <fi:value>1</fi:value>
       <fi:value>3</fi:value>
    </fi:values>
    <fi:selection-list>
            <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>
    </fi:selection-list>
</fi:multivaluefield>

So there is no need for a "selected="true"" or similar attribute on the

items of the selection list.

Cheers,
Johannes

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: [EMAIL PROTECTED] 
For additional commands, e-mail: [EMAIL PROTECTED] 



-- 
This message is subject to the CSIR's copyright, terms and conditions and
e-mail legal notice. Views expressed herein do not necessarily represent the
views of the CSIR.
 
CSIR E-mail Legal Notice
http://mail.csir.co.za/CSIR_eMail_Legal_Notice.html 
 
CSIR Copyright, Terms and Conditions
http://mail.csir.co.za/CSIR_Copyright.html 
 
For electronic copies of the CSIR Copyright, Terms and Conditions and the CSIR
Legal Notice send a blank message with REQUEST LEGAL in the subject line to
[EMAIL PROTECTED]


This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to