• 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

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
reply
    Bookmark Topic Watch Topic
  • New Topic