• 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

<h:selectOneMenu issue

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have the following select box code:

<h:selectOneMenu id="version" value="#{myBean.versionSelection}" >
<a4j:support event="onchange" action="#{myBean.changeVersion}" status="loadStatus" reRender="panel"/>
<f:selectItems value="#{myBean.versionSelectionItems}" />
</h:selectOneMenu>

What I need to do is check before the user selects a version in a select box to see if they have changed any values in the form. Select a new version in the select box brings new data to the page.

I have added an onsubmit in the <a4j:support :



This does allow my javascript to see if I have a there is a flag set for a change, keeps the form the same to allow the user to save it but the selectbox is already changed to what the user wanted. Is there a way to execute the onsubmit before the select box is actually changed. I would like to execute my javascript as soon as the user tries to change the selectbox not after they have changed it.

Thanks.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic