• 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
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

HtmlSelectOneMenu initialization

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello there!

Is it possible to manually set the selected value of a HtmlSelectOneMenu from the backing java class? What im trying to do is the following: I have some HtmlSelectOneMenus which contain data that is bound to the values of the other HtmlSelectOneMenus. For example when i select 1 in the first HtmlSelectOneMenu the second HtmlSelectOneMenu contains the selectitems 4,5,6. If i choose 2 as the selected value in the first HtmlSelectOneMenu the second one contains 7,8,9 as selectitems. I have done this by adding a javascript that submits the form when there was a change in one of my HtmlSelectOneMenus. It works fine but one point i couldnt figure out yet. When the form is submitted the HtmlSelectOneMenus reset their state which is not nice because the user doesnt see what he initially selected. How can i get around this and make the HtmlSelectOneMenus keep the users choice even after the page has been submitted?
 
I'm just a poor boy, I need no sympathy, because I'm easy come, easy go, little high, little low, little ad
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic