Uploaded image for project: 'PUBLIC - Liferay Faces'
  1. PUBLIC - Liferay Faces
  2. FACES-2061

Liferay Faces Bridge does not support the PrimeFaces 4.x/5.x client side validation

    Details

      Description

      When PrimeFaces client side validation is enabled, the org.primefaces.renderkit.HeadRenderer class adds the validation.js resource and renders an inline <script>...</script>. However, since Liferay Faces Bridge overrides the PrimeFaces head renderer, it does not get an opportunity to do this. The fix would be to have the bridge's head renderer delegate to the PrimeFaces head renderer.

      Steps to Reproduce:

      1. Add the following to the WEB-INF/web.xml descriptor of any PrimeFaces 4.0/5.0/5.1 portlet:

      <context-param>
          <param-name>primefaces.CLIENT_SIDE_VALIDATION</param-name>
          <param-value>true</param-value>
      </context-param>
      

      2. Enable client-side validation during form submission using the validateClient attribute. For example:

      <h:form>
          <p:inputText id="fullName" value="#{fooBean.fullName}" required="true" />
          <p:message for="fullName" />
          <p:commandButton action="#{fooBean.submit}" update="@form" validateClient="true" value="Submit" />
      </h:form>
      

      3. Deploy the portlet to Liferay Portal

      4. Add the portlet to a portal page

      5. Reload/view the portal page in Chrome

      6. Click on the View->Developer->View Source menu item in Chrome

      If the bug still exists, then the validation.js resource will not appear on the page AND if you click the Submit button, an HTTP POST will occur (and the "required" validation error message will appear after the HTTP POST).

      If the bug is fixed, the "required" validation error message should appear WITHOUT an HTTP POST.

        Attachments

          Activity

            People

            Assignee:
            neil.griffin Neil Griffin
            Reporter:
            neil.griffin Neil Griffin
            Participants of an Issue:
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Packages

                Version Package
                liferay-faces-3.1.5-ga6
                liferay-faces-3.2.5-ga6
                liferay-faces-4.2.5-ga6