I am using Java EE 5, JSF 1.2, JQuery and JavaScript.
I have a form that contains two buttons, and each button has to submit different things. Here's a very simple example of what I have.
<h:form>
<h:inputText id="emailInput" value="#{MyBean.Email}" required="true"/>
<h:commandLink id="accept" action="#{MyBean.Accept}">
<h:outputText value="Accept"/>
</h:commandLink>
<h:commandLink id="cancel" action="#{MyBean.Cancel}">
<h:outputText value="Cancel"/>
</h:commandLink>
</h:form>
I can't separate them into two forms. I need a way to make it so that if the Accept button is clicked, the email is submitted, but if the Cancel button is clicked, is submits nothing.
Any ideas?
Thanks!