• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 169
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
will you give me your action mapping in which u r added a row please?
 
Srilakshmi Vara
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 169
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
help me :-(
 
What could go wrong in a swell place like "The Evil Eye"? Or with this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic