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

liferay-ui:input-editor causes invalid DOM diff during Ajax postback when used with ICEfaces

    Details

      Description

      The liferay-ui:input-editor is a Facelet composite component, but references a Java-based liferay-ui-internal:input-editor UIComponent. The InputEditorInternalRenderer.java class invokes a RequestDispatcher in order to capture the output of the out-of-the-box liferay-ui:input-editor JSP tag.

      During the RENDER_PHASE of the portlet lifecycle, the liferay-ui:input-editor JSP tag renders markup that looks like this:

      <div class="">
      	<textarea id="_myportlet_WAR_myportlet_A2464:f1:comments1" name="_myportlet_WAR_myportlet_A2464:f1:comments1" style="display: none;"></textarea>
      </div>
      

      Additionally, it appends <script>...</script> elements to the value of the "LIFERAY_SHARED_AUI_SCRIPT_DATA" request attribute so that they will appear at the bottom of the rendered portal page.

      But during the RESOURCE_PHASE of the portlet lifecycle (triggered by f:ajax), the liferay-ui:input-editor JSP tag renders markup that INCLUDES the aforementioned <script>...</script> elements. The reason for this, is because the "LIFERAY_SHARED_AUI_SCRIPT_DATA" approach cannot be used during Ajax.

      The problem is that this additional markup causes ICEfaces to detect a DOM diff, and which causes the CKEditor(s) to be unnecessarily replaced in the DOM of the browser. The fix would be to have the InputEditorInternalRenderer.java class remove the additional markup during the RESOURCE_PHASE for any component instances that do not need to be re-initialized.

      An additional fix is that any <script>...</script> elements must be moved out of the response markup to the ICEfaces JavaScriptRunner so that it does not become a factor with the ICEfaces DOM-diff algorithm.

        Attachments

          Issue Links

            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.0.1-legacy-ga2
                  liferay-faces-3.0.1-ga2
                  liferay-faces-3.1.1-ga2
                  liferay-faces-3.2.4-ga5