You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Toni Nehme <tn...@hotmail.com> on 2002/07/02 21:10:11 UTC

html:Checkbox tag in Logic:iterate does not work

Hi everyone,

I have an html:checkbox in logic:iterate and I would like to know
what row the user checked after I submit the form.

My Form has an ArrayList of Objects.
My action reads the arraylist and check to see witch item is selected.

My jsp is:

<logic:iterate id="fruits" name="FRUITS" scope="session" property="fruits" 
type="ch.thales.model.Fruit">
    <tr>
        <td><html:checkbox name="fruits"  indexed="true" 
property="isChecked"/></td>
        <td><bean:write name="fruits" property="fruitName"/></td>
    </tr>
</logic:iterate>


My Action is :


        if(session != null)
        {
            System.out.println(" The following fruits are selected:\n");

            System.out.println("serviceForm.getSelectedItems().length ====   
    "+serviceForm.getSelectedItems().length);
            for(int i=0;i<ar.size();i++)
            {
                if(((Fruit)ar.get(i)).getIsChecked() == true)
                {
                    System.out.println(((Fruit)ar.get(i)).getFruitName());
                }
            }
        }
        else
        {
            return (mapping.findForward("failure"));
        }

        return (mapping.findForward("success"));
    }


Please let me know.


Toni.


_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>