aspose file tools*
The moose likes Struts and the fly likes How to Index text box inside the logic:iterate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to Index text box inside the logic:iterate" Watch "How to Index text box inside the logic:iterate" New topic
Author

How to Index text box inside the logic:iterate

vikram nalagampalli
Ranch Hand

Joined: Oct 08, 2001
Posts: 91
Hi all,
This is what i am trying to achieve, Based on user choice i am generating that many text boxes for the user to enter certain values. The values that user entered in the text boxes need to be captured and evaluated. I am not able to figure out how i can capture this data in textboxes which are indexed in my action class. My logic tag is as follows
if i look at the (view Source) in html this is how the below code is seen
Bean[0].testValues
..
...
....
Bean[n].testValues
where "testValue" is the name of my textbox i am trying to capture. I am wondering if i need to do something different in my MachineDataViewBean. Currently it only have getter setter methods for "testValues"
<logic:iterate id="blisterView" name="MachineDataViewBean" property="blisterList" scope="session">
<tr>
<td height="24" width="25%" class="odd"><bean:write name="blisterView" property="cavityName"/> </td>
<td height="24" width="40%" class="odd"><so:text property="testValues" viewBean="MachineTestViewBean" indexed="true"></so:text> </td>
<td height="20" width="25%" class="odd"><bean:write name="MachineTestViewBean" property="testResult"/></td>
</tr>

</logic:iterate>
Rick Hightower
Author
Ranch Hand

Joined: Feb 20, 2002
Posts: 350
The indexed attribute of html:text is used to render indexed property names. The indexed attribute only works in the context of the logic:iterate tag.
<html:text property="foo" indexed="true" ...


Rick Hightower is CTO of Mammatus which focuses on Cloud Computing, EC2, etc. Rick is invovled in Java CDI and Java EE as well. linkedin,twitter,blog
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to Index text box inside the logic:iterate