• 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

How to take dynamic values of textboxes to Action class

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

In my page am having two dropdown on combination of two am getting results of 10 values.
Now I need to display the 10 values with 12 textboxes for each, i.e I will get 120 textboxes totally. Where user will fill the values and submit the page.

How to take these values to action page so that I can update the values in database?

And also like if already there is values for the 12 boxes for each element I need to display them by default.

Please give me a logic for this as am new to this.


Regards,
Kartik
 
Bartender
Posts: 4116
72
Mac TypeScript Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Kartik Talasu wrote:In my page am having two dropdown on combination of two am getting results of 10 values.


Are you saying you have two select boxes each with five values or ... ?

Now I need to display the 10 values with 12 textboxes for each, i.e I will get 120 textboxes totally. Where user will fill the values and submit the page.


How to display 10 values in 12 text boxes?

How to take these values to action page so that I can update the values in database?


Are you working with any framework here?
 
Kartik Tal
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I mean to say like as am having two dropdown's ID and PLACE on change of both am accessing database and getting some results of 5 or 10 or 20 values or etc......

Suppose i choose ID as 1 and PLACE as India I will get results of 3 people names like A,B and C
so next to A i need to show 12 textboxes, again next to B i need to show 12 textboxes and next to C i need to show 12 textboxes.

And the user will fill some values in these 36 textboxes and submit the page.Now i need to read and save in DB. Am using STRUTS framework.


Regards,
Kartik
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
gaurav kant
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here i am expecting that You have created text boxes as much as You need on page with the help of java script (if not then tell us, i will tell you ).
now put name Your test boxes say You have 3 text boxes
textBox1
textBox2
textBox3

put another hidden text box (say "allTextName") in which You will store comma separated string of name of all text boxes for example "allTextName" value will be "textBox1,textBox2,textBox3"
and while adding or deleting text boxes, update "allTextName".
Now in Your action class, simply get
request.getParameter("allTextName") and tokanize it through ",". at this point You have all the names of textboxes just put in request.getParameter() and fetch the values

Hope it will work
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please be sure to ask Struts questions in the Struts forum. I have moved this post there for you.
 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use struts indexed properties for the dynamic values.

May the following link will be useful for you
Struts indexed properties
 
reply
    Bookmark Topic Watch Topic
  • New Topic