ICEfaces
  1. ICEfaces
  2. ICE-6164

Conflicting versions of YUI 3 between ACE components and Liferay 6

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0-Beta1
    • Fix Version/s: 2.1-Beta2, 3.0
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      ICEfaces 2 ACE Liferay portlet 6
    • Affects:
      Compatibility/Configuration

      Description

      The new ACE components rely on YUI (both 2.8 and 3.1 currently). Liferay 6 has a UI layer called Alloy that is based on YUI 3.2. While it appears that YUI 2 and 3 can co-exist on a page, there currently appears to be a collision between the 2 different versions of YUI 3 when they are both loaded into the portal page. The initial rendering of the page dumps out an error to the JavaScript console of Firebug that says:

      f.applyConfig is not a function

      The Chrome JavaScript console supplies a stack trace:

      Loading modules
      barebone.jsp:1Uncaught TypeError: Object [object Object] has no method 'applyConfig'
      YUI [barebone.jsp:1]
      YUI [barebone.jsp:1]
      ice.yui3.use [icefaces-2-ace:55]
      (anonymous function) [icefaces-2-ace:83]

        Issue Links

          Activity

          Hide
          Mircea Toma added a comment -

          It seems that YUI code can be sandboxed by using an iframe. The iframe would need to reference internally the required library version and then the parent window can access the 'YUI' namespace and the rest of the API.
          The only drawback is that you can use the YUI instance but when using its API you always need to pass element references instead of using IDs otherwise YUI will lookup by ID in the iframe owned document.

          Show
          Mircea Toma added a comment - It seems that YUI code can be sandboxed by using an iframe. The iframe would need to reference internally the required library version and then the parent window can access the 'YUI' namespace and the rest of the API. The only drawback is that you can use the YUI instance but when using its API you always need to pass element references instead of using IDs otherwise YUI will lookup by ID in the iframe owned document.
          Hide
          Mircea Toma added a comment -

          The main drawback of using an iframe to sandbox code is that the referenced code is not loaded before the body of the iframe containing page is parsed. This in effect bans the use of inline JS code in the markup, but unfortunately the inlining is required to initialize the different YUI components.

          Show
          Mircea Toma added a comment - The main drawback of using an iframe to sandbox code is that the referenced code is not loaded before the body of the iframe containing page is parsed. This in effect bans the use of inline JS code in the markup, but unfortunately the inlining is required to initialize the different YUI components.
          Hide
          Mircea Toma added a comment -

          Modified the component renderer to render JS code to be executed only after the document would load, in effect delaying the YUI component initialization until the iframe referenced code would load. Doing this for Slider component resulted in a correct rendering and initialization of the component but interacting with the slider was not possible, grabbing the cursor to slide it would not work.

          Show
          Mircea Toma added a comment - Modified the component renderer to render JS code to be executed only after the document would load, in effect delaying the YUI component initialization until the iframe referenced code would load. Doing this for Slider component resulted in a correct rendering and initialization of the component but interacting with the slider was not possible, grabbing the cursor to slide it would not work.
          Hide
          Navin Agarwal added a comment - - edited

          Hi can any one tell when we will be able to get the Advanced Components support for portlet development on Liferay 6. I need these feature in my Project

          Show
          Navin Agarwal added a comment - - edited Hi can any one tell when we will be able to get the Advanced Components support for portlet development on Liferay 6. I need these feature in my Project
          Hide
          Ken Fyten added a comment -

          Note that support for using ACE components with Liferay 5 was added in ICEfaces 2.0.2. This issue pertains only to using Liferay 6 with ACE components.

          This is scheduled for resolution with ICEfaces 2.1.

          Show
          Ken Fyten added a comment - Note that support for using ACE components with Liferay 5 was added in ICEfaces 2.0.2. This issue pertains only to using Liferay 6 with ACE components. This is scheduled for resolution with ICEfaces 2.1.

            People

            • Assignee:
              Ken Fyten
              Reporter:
              Deryk Sinotte
            • Votes:
              4 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: