• 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

Help in passing List of VO using form from JSP to action in struts 1.2.9

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am having a JSP which has two labels four check boxes and four text fields. Since this is a set of data and can be dynamic these fields are stored in a value object and stored in a list and this list is passed to the action class.
The isue is when the form is sumbitted I am not able to get the updated list ofvalues through form into Struts.

I am using Struts 1.2.9

Code snippet of jsp below. Any urgent reply is highely appreciated as this has been wasting my weekends and sleep.

<logic:iterate name="monthlyGainLossForm" property="ptcList" id="ptc">
<mf:td>
<html:text name="ptc" property="ptcName" />
<html:hidden name ="ptc" property="ptcName"/>
</mf:td>
<mf:td><html:text name="ptc" property="ptcActive" /></mf:td>
<html:hidden name ="ptc" property="ptcActive"/>
<mf:td><html:checkbox name="ptc" disabled="false" property="msaPtcLtcGLType" styleClass="input"/>
<html:hidden name ="ptc" property="msaPtcLtcGLType"/></mf:td>
<mf:td><html:text name="ptc" readonly="true" property="msaPtcLtcGLAmt" styleClass="input"/>
<html:hidden name ="ptc" property="msaPtcLtcGLType"/></mf:td>
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You want to use indexed properties
 
vivek jose
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The code snippet was not the full one. But the issue was values not getting passed to action. It got fixed by putting the below line of code in JSP. This way I will get values through form in action.

<logic:iterate name="monthlyGainLossForm" property="ptcList" id="productTaxCat">
<html:hidden name="productTaxCat" property="ptcId" indexed="true" />
<html:hidden name="productTaxCat" property="ptcName" indexed="true" />
<html:hidden name="productTaxCat" property="ptcActive" indexed="true" />
<mf:tr>
<mf:td><bean:write name="productTaxCat" property="ptcName"/></mf:td>
<mf:td><bean:write name="productTaxCat" property="ptcActive"/></mf:td>
<mf:td><html:checkbox name="productTaxCat" property="msaPtcLtcGLType" styleClass="input" indexed="true"/></mf:td>
<mf:td><html:text name="productTaxCat" property="msaPtcLtcGLAmt" styleClass="label" style="width:100px;vertical-align:middle;" disabled="true" indexed="true"/></mf:td>
<mf:td><html:checkbox name="productTaxCat" property="msaMthlyStcGLType" styleClass="input" indexed="true"/></mf:td>
<mf:td><html:text name="productTaxCat" property="msaMthlyStcGLAmt" disabled="true" styleClass="label" style="width:100px;vertical-align:middle;" indexed="true"/></mf:td>
<mf:td><html:checkbox name="productTaxCat" property="nonMsaPtcGLType" styleClass="input" indexed="true"/></mf:td>
<mf:td><html:text name="productTaxCat" property="nonMsaPtcGLAmt" disabled="true" styleClass="label" style="width:100px;vertical-align:middle;" indexed="true"/></mf:td>
<mf:td><html:checkbox name="productTaxCat" property="nonMsaStcGLType" styleClass="input" indexed="true"/></mf:td>
<mf:td><html:text name="productTaxCat" property="nonMsaStcGLAmt" disabled="true" styleClass="label" style="width:100px;vertical-align:middle;" indexed="true"/></mf:td>
</mf:tr>
</logic:iterate>
reply
    Bookmark Topic Watch Topic
  • New Topic