I have a button called "Send" in a page that has a form, and I use this Form from two differents pages for send mails.
From the first page I enter to this form and I must to use the methodOne
.
From the second page I enter to the same form and I must to use the methodTwo
.
Mothod examples is like this:
public Navigation methodOne(){
return Navigation.NAVIG_ONE;
}
public Navigation methodTwo(){
return Navigation.NAVIG_TWO;
}
and the form example:
<h:form>
<p:outputLabel id="email" value="#{service.Mail}"/>
<p:inputText id="subject" value="#{service.Subject}"/>
<p:inputTextarea id="body" value="#{service.Body}" />
<p:commandButton value="send" action="#{service.methodOne}" />
</h:form>
I want to use the same Form for use two differents methods.
How to use the methodOne
and methodTwo
in the same action
attrubite of tag <p:commandButton />
?