• 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

populating select options from database help urgent!!!!

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In my application one page where i am getting details of user
on submission it calls one action /saveDetails (/saveDetails that maps to SaveDetailsAction.java).
In this page there is one select for country.on selection of country it is to load state in the next select with respect to country selected.
(Now i am doing it with javascript but to change as said above).
for this which is better way. i tried by creating a new Action class , Form class and selects onChange=reload() i am calling that action by
------------------------code---------------
function reload()
{
document.forms[0].action='getstate.do'; //maps to StateCountry.class
document.forms[0].submit();

}

But my PL is not satisfied with this, bcz he never wanted to create new Action class for this .
please give a solution for this.....(especially for using same action class ie here SaveDetailAction.....
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You could in your Action check to see if a button was clicked as any clicked button would be added as a parameter to the submission.

Since the country drop-down is not a button, there should be no button parameter sent with the post.

The Action would say (roughly):
if(button is null){
change state values in the ActionForm
}else{ // button was clicked
do the normal stuff
}
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic