• 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

Need suggestions and help for my scenario in struts

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

As I am new to Struts, I need to develop a scenario.

I need to create a select box on my JSP page the values in this select box will be coming from the database.

When I select an option from the select box, the other values from the same table will be populated on the same JSP page but in a tabular format.

The values will be in a form format, including some text boxes and checkboxes.

Kindly suggest me with some examples or scenario.


-Thanks & Regards,
Kaushal K. Sharma

 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sounds like you want an Ajax request fired off when the select box changes.
 
kaushal sharma
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi David,

I understand your suggestion but i want to use javascript as i know we can get an ID of every select option, so can't we send the ID to my Action Servlet when it's selected? It may feel the page is refreshed or do we try something else?



-Thanks & regards,
Kaushal K. Sharma




 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I may be misunderstanding you.

My suggestion *was* to use JavaScript, make an Ajax request when the select box is changed, and send back just the HTML for the table containing the data based on the ID (or whatever) selected in the select box.
 
kaushal sharma
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi David,

hope you would have some documents available online in response to my work. i do not know AJAX. Please suggest me so, that i will be able to understand the development part.


-Thanks
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you're going to use Ajax, just search the web for Ajax. I'd *strongly* recommend using a JavaScript library if you go that route--doing it without a library (like jQuery, Prototype, whatever) is a pretty bad idea.
reply
    Bookmark Topic Watch Topic
  • New Topic