• 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
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Dynamic indexed properties of USER-INPUTS from JSP Form to Struts-bean and Through-out.

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

I've brand-new requirement. My requirement is, I've User-Input Form(JSP). In that form I've Text fields Name and Age and I given Add button and Another Text box named Others next to the Age Text-field, So that I(user) can add any number of text fields I(user) want.

Name : [TextField]
Age : [TextField] Others: [TextField] Add[Button]

SUBMIT[button]

If the user Typed Gender in Others "TextField" and clicks Add button. Then My form Will be,

Name : [TextField]
Age : [TextField]
Gender: [TextField] Others: [TextField] Add[Button] Delete[Button].

SUBMIT[button]

If he entered something in Others, again Another field Will be created in the form. Now clicks on SUBMIT, I've to pass those parameters Name, Age, Gender(If user enters), etc.,(User entered fields). I've to inject those params from JSP to Bean in struts-2. I think it is not possible. If possible, Please help me guys. Please send some example code.

For further details please see HERE.



Thanks:
Ramakrishna k.c
 
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
Injection has a specific meaning that has nothing to do with your task. The term for the struts side is indexed properties. You appear to have the javascript side of this under way. On the javascript side, give each field a name with a index then Struts knows to turn those fields into a collection for your action.
 
Ramakrishna Udupa
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Thanks for the reply. Yes, I've JavaScript which is exactly on the link I specified. i.e




JSP page:






This is my snippet. Can you please guide me step by step how to do or modify this code, the way it has to be.
 
Ramakrishna Udupa
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I think this code may help you guys to get the my problem correctly.





Thanks:
Ramakrishna K.C
 
Yeah, but does being a ninja come with a dental plan? And what about this tiny ad?
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic