ICEfaces
  1. ICEfaces
  2. ICE-8848

ResourceOrdering causes problems with MyFaces

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: EE-3.2.0.BETA
    • Fix Version/s: EE-3.2.0.GA
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      MyFaces
    • Assignee Priority:
      P1

      Description

      When trying to run the showcase application with MyFaces instead of Mojarra, I ran into a problem where numerous JavaScript exceptions were thrown by the client. It seems to be related to ResourceOrdering.

      It looks like all the requisite files are being loaded so I thought it might be a question of the order. When I put some debugging in the ResourceOrdering class I saw that the ordered resources were being processed the same way:

      MyFaces

      ResourceOrdering.orderResources: head facet is called head
      ResourceOrdering.orderResources: resource container org.apache.myfaces.component.ComponentResourceContainer@22c9af86
      ResourceOrdering.orderResources: added themes/sam/theme.css as a defined resource
      ResourceOrdering.orderResources: added jsf.js as a defined resource
      ResourceOrdering.orderResources: added util/ace-yui.js as a defined resource
      ResourceOrdering.orderResources: added util/combined.css as a defined resource
      ResourceOrdering.orderResources: added util/ace-jquery.js as a defined resource
      etc...

      Mojarra

      ResourceOrdering.orderResources: head facet is called javax_faces_location_HEAD
      ResourceOrdering.orderResources: resource container com.sun.faces.component.ComponentResourceContainer@5bbe1466
      ResourceOrdering.orderResources: added themes/sam/theme.css as a defined resource
      ResourceOrdering.orderResources: added jsf.js as a defined resource
      ResourceOrdering.orderResources: added util/ace-yui.js as a defined resource
      ResourceOrdering.orderResources: added util/combined.css as a defined resource
      ResourceOrdering.orderResources: added util/ace-jquery.js as a defined resource
      etc…

      But when I looked at the final rendered output, the Mojarra markup matches the order we added the resources but the MyFaces code does not - it's in some other unpredictable order. So it seems that the ResourceOrdering strategy is not working the same way with MyFaces. - that is, the underlying collection/list/set/map is not honouring the order that we're adding the resources back in (or something to that effect).

        Activity

        Hide
        Carmen Cristurean added a comment -

        Attaching screen shot with the window.ice undefined JS error (ICE-6080 & ICE-7019).

        Show
        Carmen Cristurean added a comment - Attaching screen shot with the window.ice undefined JS error (ICE-6080 & ICE-7019 ).
        Hide
        Mircea Toma added a comment -

        1) The issue was mainly caused by icefaces-compat.uncompressed.js resource dependency data, the library name was the empty string while it should have been "ice.compat".
        But this problem prompted me to understand why icefaces-compat.uncompressed.js wasn't added last even when its resource dependency data was missing (or not matching). It turned out the resources without dependency data were not first removed from view root but just re-added after the ordered resources were put in.

        So ResourceOrdering.orderResources method was modified to make sure that the resource components that do not have resource dependency data to first remove them from the view root and then added last after the ordered resource components were put in.
        Also modified BridgeSetup and ExtrasSetup to provide "name" and "library" attributes to the components responsible for renedering the bridge and compat setup code. Defined dependency data for the setup code.

        Show
        Mircea Toma added a comment - 1) The issue was mainly caused by icefaces-compat.uncompressed.js resource dependency data, the library name was the empty string while it should have been "ice.compat". But this problem prompted me to understand why icefaces-compat.uncompressed.js wasn't added last even when its resource dependency data was missing (or not matching). It turned out the resources without dependency data were not first removed from view root but just re-added after the ordered resources were put in. So ResourceOrdering.orderResources method was modified to make sure that the resource components that do not have resource dependency data to first remove them from the view root and then added last after the ordered resource components were put in. Also modified BridgeSetup and ExtrasSetup to provide "name" and "library" attributes to the components responsible for renedering the bridge and compat setup code. Defined dependency data for the setup code.
        Hide
        Mircea Toma added a comment -

        2) Modified ace and compat GMapResourceHandler.ResourceEntry implmentation to return corresponding resource and library name when Resource.getResourceName or Resource.getLibraryName methods are invoked.

        Show
        Mircea Toma added a comment - 2) Modified ace and compat GMapResourceHandler.ResourceEntry implmentation to return corresponding resource and library name when Resource.getResourceName or Resource.getLibraryName methods are invoked.
        Hide
        Carmen Cristurean added a comment - - edited

        At rev# 33005, the 'window.ice' JS error and ace:gMap HTTP 500 error have been resolved; the Http 500 error still exists for ace:richTextEntry.

        Show
        Carmen Cristurean added a comment - - edited At rev# 33005, the 'window.ice' JS error and ace:gMap HTTP 500 error have been resolved; the Http 500 error still exists for ace:richTextEntry.
        Hide
        Ken Fyten added a comment -

        New issue with ace:richTextEntry is tracked under ICE-8864.

        Show
        Ken Fyten added a comment - New issue with ace:richTextEntry is tracked under ICE-8864.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: