Stephane

This is the code I use in my script for accessing
and forwarding on the multi-value field data... 
maybe its not the best way but it works for me!

  var themeForm = new Form("forms/model_form.xml"); 
  themeForm.showForm("form-display");

  /* extract data from multi-select field */
 /* 'theme' is the name of the multi-field widget */
  var tmodel = themeForm.getModel();  
  var themeValues = Array();
  for( i = 0; i < tmodel.theme.length ; i ++ ) 
    themeValues[i] = tmodel.theme[i];
    
  cocoon.session.setAttribute('itheme',themeValues);

The "itheme" variable can now be accessed from, say,
a JXTemplate generator, for further processing...

 <jx:forEach varStatus="thisTheme"
items="${cocoon.session.getAttribute('itheme')}">
   <!-- do good stuff here -->
 </jx:forEach>  

HTH
Derek

>>> [EMAIL PROTECTED] 2004/07/06 12:00:49 PM >>>


My datatype is String for both MVF.

I would have writen something like :

// this is ok
cocoon.request.setAttribute("myForm", form.getWidget());
var reqAttf = cocoon.request.getAttribute("myForm");

var myMVFWidget  = reqAttf.lookupWidget("myMVF");

// this does not work and is still a mystery for me (the cats seems to
be
not allowed in javascript)
Array myArray = (Array) myMFVWidget.getValue();

Stephane

>> Hi,
>>
>> I am trying to get my cforms multipleValueFields.
>> I tried to get the values of the user's selected fields.
>> Thus, I really don't know how to do this since the getValue() of
the
>> multiplevaluefield widget return an objetc.
>> This object is an array but I don't know how to cast the object to
be an
>> Array an then, retrieve my values ?
>>
>> Any idea or sample ?

>What's your datatype of that field? The object should be an array of
>that datatype.


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


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.


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

Reply via email to