Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

<h:selectOneMenu issue  RSS feed

Richard Roszak
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}" />

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.

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!