But shouldn't u  want to give value attribute to mulitbox tag ??. As
<html:multibox> tag says if the value attribute content if matches with the
any element of array property in the form bean then only the checkbox is
checked else it will be unchecked . !!!!!

I think it should be like this .

<html:form action="skills.do">
    <logic:iterate id="currentSkill" property="skillsList">  // here
skillList is Vector  attribute in the form bean .
    <html:multibox property="skill"  value="<%= currentSkill %>" >
            <%=    currentSkill %>
    </html:multibox>
    </logic:iterate>
</html:form>

Have a method in the form bean

public String []  getSkill() {
    return new String [] {"java" , "c" , "c++"};
}


If  the curretSkill contains  "java" then it matches with one in getSkill
 ) method in bean. so it will be checked. Suppose if it is iterator gives
skill as "C#" then it will not match with any values returned by getSkill
 ) method . So that time it wil be unchecked.

suhas


----- Original Message -----
From: Leander Jedamus <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 12, 2001 9:33 AM
Subject: Re: multiple checkboxes


Hi!

Thanks Meeraj,
i will look into that.

Leander

Meeraj Kunnumpurath wrote:
>
> You can only define the multibox tag within the form tag. I think the
> multibox tag will check for an indexed property within the form bean
> corresponding to the name defined for the checkoxes and render each one of
> them as checked or unchecked accordingly.
>
> An example is shown below
>
> <html:form action="validateEmployee.do">
>         <logic:iterate id="currentSkill" name="skillsList">
>                 <html:multibox property="skills">
>                         <%= currentSkill %>
>                 </html:multibox>
>                 <%= currentSkill %>
>                 <br/>
>         </logic:iterate>
> <html:form action="validateEmployee.do">
>
> In the example above the body content of the multibox tag is used to
define
> the value attribute of each check box. The name of all the checkboxes will
> be skills. The state of each checkbox is computed by checking the indexed
> property skills defined in the action form bean. You can also use the
> multibox tag without relying on the body content.
>
> Regards
>
> <Meeraj/>
>
> -----Original Message-----
> From: Leander Jedamus [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 12, 2001 8:41 AM
> To: [EMAIL PROTECTED]
> Subject: Re: multiple checkboxes
>
> Hi!
>
> Now my question is, how do I get the aid from the Form into the
> checkbox?
>
> Meeraj Kunnumpurath wrote:
> >
> > You can use the multibox tag
> >
> > Regards
> >
> > <Meeraj/>
> >
> > -----Original Message-----
> > From: Leander Jedamus [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, July 12, 2001 8:21 AM
> > To: [EMAIL PROTECTED]
> > Subject: multiple checkboxes
> >
> > Hi!
> >
> > I have one problem I cannot solve on my own.
> > I have an not known number of answers with answer-ids in my database.
> > Now I want to create a Form to reflect that.
> > How do I manage an array of checkboxes?
> > What do I have to do to get the following HTML-code?:
> > <input type="checkbox" name="aids" value="4">Text
> > <input type="checkbox" name="aids" value="2" checked>Text2
> >
> > Thanks in advance
> > Leander
> > --
> > Dipl.-Inf. (FH) Leander Jedamus
> > Presse- und Öffentlichkeitsarbeit
> > Fachhochschule Worms, Erenburgerstr. 19, 67549 Worms, Tel.: 06241
> > 509-169
> > mailto:[EMAIL PROTECTED]
>
> --
> Dipl.-Inf. (FH) Leander Jedamus
> Presse- und Öffentlichkeitsarbeit
> Fachhochschule Worms, Erenburgerstr. 19, 67549 Worms, Tel.: 06241
> 509-169
> mailto:[EMAIL PROTECTED]

--
Dipl.-Inf. (FH) Leander Jedamus
Presse- und Öffentlichkeitsarbeit
Fachhochschule Worms, Erenburgerstr. 19, 67549 Worms, Tel.: 06241
509-169
mailto:[EMAIL PROTECTED]

Reply via email to