• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

dynamic textbox generation in struts...

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hai,,

i want to generate dynamic textbox according to my count value..

i will get count on the page load.. according to that i want to generate number of texbox in that page.. please help me how to do this in struts..
how shall i create form bean for this...

please help me.. i m new to struts....

Swathi
 
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Create a Form bean which has getter and setter methods for count and another method for all the textboxes together which returns string[] array and in jsp check count and start displaying the text box in logic:iterate method.
 
Swathi Prakash
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks Srilakshmi,,

one confusion how to get the string array values from logic iterate to Action .. can u give some small examples..please help me .. i m new to struts..

Swathi
 
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
Ok Swathi,

I am sorry, your count is just a variable right then you cannot use logic:iterate

Use JSTL For loop
<c:forEach begin="1" end="count">
<html:text name="formname" property="propName">
</c:forEach>

If you give same name for multiple text boxes in returns the values in String array.

HTH
Srilakshmi
 
Swathi Prakash
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks SriLakshmi... lot of thanks pa
 
permaculture is giving a gift to your future self. After reading this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic