• 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 ...
  • Campbell Ritchie
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown

HtmlSelectOneMenu initialization

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?
Surfs up space ponies, I'm making gravy without this lumpy, tiny ad:
a bit of art, as a gift, the permaculture playing cards
    Bookmark Topic Watch Topic
  • New Topic