Win a copy of Machine Learning for Business: Using Amazon SageMaker and JupyterE this week in the Jython/Python forum
or Object Design Style Guide in the Object-Oriented programming forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

<h:selectOneMenu issue

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • 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.
 
I'm just a poor boy, I need no sympathy, because I'm easy come, easy go, little high, little low, little ad
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!