In the JSF application, when "reset" or "button" (except "submit") is specified in the "type" attribute of the <h:commandButton> tag, "submit" processing is executed.
In the HTML style, when the reset button and the generic button (press the click/enter key) are executed, the submit processing is not executed. However, in the JSF mounting of glassfish, if the above conditions are met, the submit processing will be executed when the reset button and the button (press the click/enter key) are executed.
Specifically, when the following conditions are met.
●Condition 1
- The <h:form> tag contains the "onsubmit" attribute.
- The <h:form> element contains child elements that match <h:commandButton> below. a) In the "type" attribute, "reset" or "button" (*1) is specified. b) There are <f:param> elements in the child elements.
- The <h:form> element and the element of the HTML form do not contain the <f:ajax> element.
- Click link or the button corresponding to the element of 2) (or press the enter key).
●Condition 2
- The <h:form> tag contains the "onsubmit" attribute.
- The <h:form> element contains child elements that match <h:commandButton> below. a) In the "type" attribute, "reset" or "button" (*1) is specified. b) Contains the "onclick" attribute. c) There are <f:param> elements in the child elements.
- The <h:form> element and the element of the HTML form contain the <f:ajax> element. "true" is specified in the "disabled" attribute.
- Click link or the button corresponding to the element of 2) (or press the enter key).
*1) When there is no attribute, it is judged that "submit" is specified.
From the original HTML style, if the value of the type attribute of the commandButton is other than "submit", "submit" should not be executed.
Is there anyone who can respond as quickly as possible, thanks very much. :)
Is there anyone who can respond as quickly as possible, thanks very much. :)
testjsf.zip I made a test app that contains the above conditions. Does anyone respond and suggest a correction.
mojarra issue tracker moved to: https://github.com/eclipse-ee4j/mojarra
The issue is moved to: https://github.com/eclipse-ee4j/mojarra/issues/4536