mojarra icon indicating copy to clipboard operation
mojarra copied to clipboard

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.

Open micRo-wlY opened this issue 7 years ago • 5 comments

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

  1. The <h:form> tag contains the "onsubmit" attribute.
  2. 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.
  3. The <h:form> element and the element of the HTML form do not contain the <f:ajax> element.
  4. Click link or the button corresponding to the element of 2) (or press the enter key).

●Condition 2

  1. The <h:form> tag contains the "onsubmit" attribute.
  2. 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.
  3. The <h:form> element and the element of the HTML form contain the <f:ajax> element.    "true" is specified in the "disabled" attribute.
  4. 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.

micRo-wlY avatar Oct 10 '18 02:10 micRo-wlY

Is there anyone who can respond as quickly as possible, thanks very much. :)

micRo-wlY avatar Dec 06 '18 07:12 micRo-wlY

Is there anyone who can respond as quickly as possible, thanks very much. :)

micRo-wlY avatar Dec 25 '18 05:12 micRo-wlY

testjsf.zip I made a test app that contains the above conditions. Does anyone respond and suggest a correction.

micRo-wlY avatar Dec 26 '18 09:12 micRo-wlY

mojarra issue tracker moved to: https://github.com/eclipse-ee4j/mojarra

erickdeoliveiraleal avatar Jan 24 '19 10:01 erickdeoliveiraleal

The issue is moved to: https://github.com/eclipse-ee4j/mojarra/issues/4536

micRo-wlY avatar Jan 30 '19 06:01 micRo-wlY