• 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

Can not update the struts form

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Guys:
I have a question. When the form submitted, the value of 'clientPageNumber' of 'pageInfo' of 'form' is still 0 instead of 5
during processing the action class on the server side.
How can I update the value of that?

Thanks.
The source is in the following:
jsp
<bean:define id="formPageInfo" name="TestForm" property="pageInfo"/>
<!-- pageInfo is a property object of form -->
<input type="hidden" id="tablePageNumber" name="tablePageNumber" value="<bean:write name="formPageInfo" property="clientPageNumber"/>"/>
<!-- clientPageNumber is a int property of pageInfo object -->

javascript
function submitFormFunction(){
document.getElementById("tablePageNumber").value= 5 + '';
document.myform.action = "/<%=StartupConstants.APPLICATION_WAR_VALUE%>/TestUpdateFormAction.do";
document.myform.submit();
}

 
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The name of the input field is going to need to match the name of the property in your form. So it sounds like the name of the input field should be pageInfo.clientPageNumber

Hope that helps.
 
jack fe
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are right.
Thanks.
 
reply
    Bookmark Topic Watch Topic
  • New Topic