Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 4.0
-
Fix Version/s: EE-4.0.0.GA, 4.1
-
Component/s: ACE-Components, MOBI-Components
-
Labels:None
-
Environment:ICEfaces 4.0 ACE and MOBI Components
-
Assignee Priority:P1
Description
As of JSF 2.2, components should avoid rendering their "required" attribute into the client browser DOM UNLESS "p:required" is specified, where "p:" is the prefix for the JSF 2.2. HTML5 Passthrough namespace (xmlns="http://xmlns.jcp.org/jsf/passthrough").
In ICEfaces 4.0, ACE and MOBI components with "required='true'" specified render "required='true'" into the corresponding input element in the browser DOM which signals to the HTLM5 browser to use HTML5 client validation to validate the element. This prevents the submit of the form from occurring, and instead renders the browser's validation error message, which is not what JSF application developers would expect. This is an unexpected an incorrect behaviour.
Instead, the components should only render the "required='true'" attribute into the input element in the browser DOM when specified using the "p:" passthrough attribute prefix, which signals to the component that the application would like to leverage HTML5 client-side validation in this case.
Respecting the two different syntaxes allows the default JSF validation behaviour to work as expected even on HTML5 browsers, while still providing the optional ability for an application developer to specify that they want the client-side validation behavior (in which case it is expected that they understand the implications, etc.).
In ICEfaces 4.0, ACE and MOBI components with "required='true'" specified render "required='true'" into the corresponding input element in the browser DOM which signals to the HTLM5 browser to use HTML5 client validation to validate the element. This prevents the submit of the form from occurring, and instead renders the browser's validation error message, which is not what JSF application developers would expect. This is an unexpected an incorrect behaviour.
Instead, the components should only render the "required='true'" attribute into the input element in the browser DOM when specified using the "p:" passthrough attribute prefix, which signals to the component that the application would like to leverage HTML5 client-side validation in this case.
Respecting the two different syntaxes allows the default JSF validation behaviour to work as expected even on HTML5 browsers, while still providing the optional ability for an application developer to specify that they want the client-side validation behavior (in which case it is expected that they understand the implications, etc.).
Issue Links
- blocks
-
ICE-10434 Deprecate ACE component attributes that overlap with HTML5 passthrough attributes
- Closed
Example A (required="true" on h:inputText)
Note the lack of the "required" attribute on the input element in this case (avoids HTML5 client validation).
Example B (p:required="true" on h:inputText)
Note the presence of "required='true'" on the input element. This signals to the browser to perform client side validation for required.