You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Bartosz Zgodzinski <ba...@poczta.onet.pl> on 2004/05/30 16:16:38 UTC

multivalue field - setValues()

When a want to inicialize a single checkbox a write:
 form.getWidget("single_checkbox").setValue(true);

What shouuld I do when a have a multivalue field with list-type="checkbox"?

I supose I should use setValeus, like this:
form.getWidget("multi_checkbox").setValues(???);

What should I write there (???). I know that this should be Object[], but I
don't know what does it sxacly mean? Please give me an example.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: multivalue field - setValues()

Posted by Bruno Dumon <br...@outerthought.org>.
On Sun, 2004-05-30 at 16:16, Bartosz Zgodzinski wrote:
> When a want to inicialize a single checkbox a write:
>  form.getWidget("single_checkbox").setValue(true);
> 
> What shouuld I do when a have a multivalue field with list-type="checkbox"?
> 
> I supose I should use setValeus, like this:
> form.getWidget("multi_checkbox").setValues(???);
> 
> What should I write there (???). I know that this should be Object[], but I
> don't know what does it sxacly mean? Please give me an example.

It should be an array of objects, and the type of the object should
correspond to the datatype defined for the multivaluefield. For example,
if that's "string", then it should be an array of java.lang.String
objects.

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org