ICEfaces
  1. ICEfaces
  2. ICE-6282

Order of portlet loading/rendering affects component behaviour

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.2-EE-GA_P01
    • Fix Version/s: 1.8.2-EE-GA_P02
    • Labels:
      None
    • Environment:
      ICEfaces 1 portal portlet Liferay 5 and 6

      Description

      Certain component showcase examples don't function as designed if they are not loaded/rendered in a certain order. Specifically, a certain subset of components appear to only function correctly if they are loaded/rendered last on a portal page. This includes the case if they are the only portlet on the page. If they are on a page with other portlets and they are not the the last one rendered, they exhibit the following issues:

      - Auto Complete: the autocomplete menu does not drop down
      - Drag N Drop: the first drag/drop operation doesn't function properly
      - Panel Positioned: will not allow any drag/drop operation (or the first one may work but further attempts will not)
      - Rich Text: has a number of different symptoms which all seem to be related to this error (from FireBug)

      [window.twbO#8] failed to insert element: <script id="twbOVQVPOy0I223ga8UZ1Q:8:dynamic-code" type="text/javascript">...</script> TypeError: Ice.FCKeditorUtility is undefined { message="Ice.FCKeditorUtility is undefined", more...}

      If the Rich Text component is not the last one rendered, the above problem will manifest itself and lead to other problems (like not being able to change toolbar modes and not saving properly).

        Activity

        Hide
        Mircea Toma added a comment -

        The issues seen with the listed components are due to the repeated loading and evaluating of the same JS files. Every time that the referenced JS code is evaluated it will create new global variables thus overwriting the previously declared ones, variables that had their state changed in the mean time.
        Introduced tests in icefaces-d2d.js and ice-extras.js to avoid having the code evaluated multiple times.

        Show
        Mircea Toma added a comment - The issues seen with the listed components are due to the repeated loading and evaluating of the same JS files. Every time that the referenced JS code is evaluated it will create new global variables thus overwriting the previously declared ones, variables that had their state changed in the mean time. Introduced tests in icefaces-d2d.js and ice-extras.js to avoid having the code evaluated multiple times.
        Hide
        Deryk Sinotte added a comment -

        Looks like the fix helped with most of the outstanding behaviours. I ran through all the portlets in Liferay 5 with FF and IE (and a few sample portlets with Safari and Chrome). The big issue I see now is only with IE. In IE, the Auto Select throws all kinds of JS errors (and pops up the offer to debug) AFTER you start typing and the menu drops down. Turn off the debugging and it still doesn't work properly. Other browsers appear to work fine.

        Just to note, the functionality is good in IE if the Auto Select is the only portlet on the page. However, if there any other portlets present (the order doesn't matter) then the problem manifests.

        Show
        Deryk Sinotte added a comment - Looks like the fix helped with most of the outstanding behaviours. I ran through all the portlets in Liferay 5 with FF and IE (and a few sample portlets with Safari and Chrome). The big issue I see now is only with IE. In IE, the Auto Select throws all kinds of JS errors (and pops up the offer to debug) AFTER you start typing and the menu drops down. Turn off the debugging and it still doesn't work properly. Other browsers appear to work fine. Just to note, the functionality is good in IE if the Auto Select is the only portlet on the page. However, if there any other portlets present (the order doesn't matter) then the problem manifests.
        Hide
        Mircea Toma added a comment -

        Evaluate Prototype files (dom.js in particular) used by ice-extras.js only once to avoid IE confusion when deciding strategy to be use for extending DOM element functionality. Issue originally solved for ICE-6039.

        Show
        Mircea Toma added a comment - Evaluate Prototype files (dom.js in particular) used by ice-extras.js only once to avoid IE confusion when deciding strategy to be use for extending DOM element functionality. Issue originally solved for ICE-6039 .

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Deryk Sinotte
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: