jQuery in Action, 2nd edition*
The moose likes Struts and the fly likes Adding 1 row to specific section of a struts table using iterate tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Adding 1 row to specific section of a struts table using iterate tag" Watch "Adding 1 row to specific section of a struts table using iterate tag" New topic
Author

Adding 1 row to specific section of a struts table using iterate tag

Jim Jones
Greenhorn

Joined: Oct 31, 2003
Posts: 1
Hi All,
Hope you all out there can help me on this one.
I'm having great trouble getting this to work.
This is what I have right now...
Description Min Max Begin Date End Date Select
1111111111 xxx xxx xxxxxx xxxxx <button>
2222222222 xxx xxx xxxxxx xxxxx <button>
3333333333 xxx xxx xxxxxx xxxxx <button>
4444444444 xxx xxx xxxxxx xxxxx <button>
When you select the row using the select button, this should happen, data associated with 2222222 should appear below it in the form of another row...
Description Min Max Begin Date End Date Select
1111111111 xxx xxx xxxxxx xxxxx <button>
2222222222 xxx xxx xxxxxx xxxxx <button>
Assoc Data min max
2222222222 xxx xxx
3333333333 xxx xxx xxxxxx xxxxx <button>
4444444444 xxx xxx xxxxxx xxxxx <button>
Similiarly, if you select the another row eg 3333333 using the select button, this should happen...
Description Min Max Begin Date End Date Select
1111111111 xxx xxx xxxxxx xxxxx <button>
2222222222 xxx xxx xxxxxx xxxxx <button>
3333333333 xxx xxx xxxxxx xxxxx <button>
Assoc Data min max
3333333333 xxx xxx
4444444444 xxx xxx xxxxxx xxxxx <button>
The table is currently defined using an iterate tag. I'm looking for some tag that I can use to insert an additional row as I discribed. This is how my code (roughly) looks like now.
<logic:iterate id="myList" name="xxxxx.myModel"
property="myDisplays" type="xxxxx.myDisplay"scope="session" indexId="index">
<tr>
<td>
<app:write ignoreexception="true" name="myList" property="myCode" filter="true"/>
</td>
<td>
<app:write ignoreexception="true" name="myList" property="myDescription" filter="true"/></td>
<td>
<app:write ignoreexception="true" name="myList" property="myMinRate" filter="true"/>
</td>
<td align="center">
<app:write ignoreexception="true" name="myList" property="myMaximumRate" filter="true"/>
</td>
<app:write ignoreexception="true" name="myList" property="myStartDate" filter="true"/>
</td>
<td>
<app:write ignoreexception="true" name="myList" property="myEndDate" filter="true"/>
</td>
<td>
<A href="/xxxxx/mySpecifiedAction.do?actionType=dosomething&rowIndex=<app:write ignoreexception="true" name="index"/>"><IMG src="images/button_view.gif" border="0"></A>
</td>
</tr>
</logic:iterate>
Any suggestions would be great. Thanx.
Srilakshmi Vara
Ranch Hand

Joined: Jul 21, 2004
Posts: 169
Does Anybody does the similar type of layout done using struts??

I need to display a set of rows using logic iterate and i need to implement add/delete row functionality to the list?

Any suggestions
Karl Beowulph
Ranch Hand

Joined: May 31, 2004
Posts: 130
When I have to add something to a list, I have the add button submit the form to my action class. From there I perform the needed operation, rebuild the list, and send the user back to the jsp.
Srilakshmi Vara
Ranch Hand

Joined: Jul 21, 2004
Posts: 169
will you give me your action mapping in which u r added a row please?
Srilakshmi Vara
Ranch Hand

Joined: Jul 21, 2004
Posts: 169
Let me explain you my problem.

I have a aaa.jsp, i am prepopulating aaa.jsp with DB values with aaa.do

I need to add a row dynamically in the aaa.jsp,
If user clicks on addrow button in aaa.jsp i am increasing the structure size using addrow.do when i am redirecting to the aaa.jsp after adding a row all the other values in the form are nullified and the state of the form is lost because both my actionmappings form scope is request.

These are my actionmappings

<action path="/aaa"
type="Displayaaa"
name="transForm"
scope="request" validate="false">
<forward name="success" path="/jsp/aaa.jsp" />
</action>
<action path="/AddRow"
type="Incrementer"
name="transForm"
scope="request" validate="false">
<forward name="success" path="/jsp/aaa.jsp" />
</action>
Srilakshmi Vara
Ranch Hand

Joined: Jul 21, 2004
Posts: 169
help me :-(
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Adding 1 row to specific section of a struts table using iterate tag