> -----Original Message----- > From: simon_delaroute [mailto:[EMAIL PROTECTED] > Sent: Sunday, July 11, 2004 7:46 PM > To: [EMAIL PROTECTED] > Subject: Checkboxes > > > Hi > I am using struts and want to display a list of options for the user > to select with checkboxes using the struts-el tags. The information > on each option is stored in an object, name, age height weight and > each of these objects is stored in an ArrayList called people which > is placed in the session. Name of object person name of ArrayList > people. > > I want the information to be displayed as a table(using a loop) each > row holding the information on a different person with check boxes at > the end of each row. The user can check as many as they want. > I can get the people ArrayList from the session scope but don't know > how to access the person objects within it or how display the data > with in each person object > . I have played around with it for a long time but have not had any > success. Thanks for any help.
Documentation says: logic:iterate id The name of a page scope JSP bean that will contain the current element of the collection on each iteration, if it is not null. So.... this should iterate through the collection <logic:iterate collection="collectionOhPeople" id="aSinglePerson"> </logic:iterate> And I want to display a bean..... so let's see what the bean taglib has..... ooo bean:write..... Name: Specifies the attribute name of the bean whose property is accessed to retrieve the value specified by property (if specified). If property is not specified, the value of this bean itself will be rendered. Property: Specifies the name of the property to be accessed on the bean specified by name. This value may be a simple, indexed, or nested property reference expression. If not specified, the bean identified by name will itself be rendered. If the specified property returns null, no output will be rendered Sooooo.... all together <logic:iterate collection="collectionOhPeople" id="aSinglePerson"> <bean:write name="aSinglePerson" property="propertyName"/> </logic:iterate> As for the checkboxes you might want to do something likes this: http://www.husted.com/struts/tips/007.html --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]