File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes dynamical page content refreshing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "dynamical page content refreshing" Watch "dynamical page content refreshing" New topic

dynamical page content refreshing

Steve Mutanson
Ranch Hand

Joined: Apr 15, 2003
Posts: 67
In my JSp page, suppose I have a radio buttons section ("product type") followed by a picklist section ("Product Name"). I want the content of the "product name" be dependent upon "product type", i.e. I want to retrieve the "product name" from database based on what "product type" user picks and then dynamically display them in the picklist after product type is picked.
I know if I put a "submit" button right after the "product type" section it should work. But this makes it cumbersome because I will neded several submit buttons if I want the page to be totally dynamically refreshable (one section be dependent on its preceding section(s)).
Is there better way to do this without puting "submit" buttons next to EACH component and having to click each one to refresh ?
Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
You can use JavaScript's onChange() function for reloading the page when any of the input elements' selections are changed. Check out the HTML/JavaScript forum(s) for details.

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
I agree. Here's the link:
subject: dynamical page content refreshing
It's not a secret anymore!