I have a simple input text element in my form.
The user has 2 possible actions to take on that form: 1) approve the form and 2) reject the form. So there are 2 buttons at the bottom of the form for the user to click on.
If the user clicks on approve
the comment
inputField should be optional. If the user clicks on reject
the comment
inputField should be required.
Here is a simple representation of the form:
<h:form>
<p:inputText id="comment" required="???" .../>
<p:commandButton id="approve" ... />
<p:commandButton id="reject" ... />
</h:form>