ICEfaces
  1. ICEfaces
  2. ICE-6621

Message(s) rendering not overridable by application

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0
    • Fix Version/s: 2.0.1
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      ICEfaces 2. Details specific to Mojarra

      Description

      We've implemented our own Message Renderer and Messages Renderer, so that the output will always be wrapped in a div, to better work with our dom differencing. As part of the MyFaces 2 integration in ICE-5868 we switched from using the faces-context.xml to override the renderers to doing it programmatically, since our renderers override the Mojarra ones, and we can't use them with MyFaces. This has the side-effect of thwarting applications from overriding the renderers themselves.

      The quickest fix would be to change the renderkit code that checks to see if we should override the renderers to do an exact class name check for the Mojarra renderers, so that we don't stomp on 3rd party renderers.
      1. CustomMessagesRenderer.java
        11 kB
        yip.ng
      1. screenshot-01.png
        107 kB
      2. screenshot-02.png
        116 kB
      3. screenshot-03.png
        104 kB

        Activity

        Mark Collette created issue -
        Ken Fyten made changes -
        Field Original Value New Value
        Salesforce Case []
        Assignee Priority P1
        Assignee Yip Ng [ yip.ng ]
        Arran Mccullough made changes -
        Salesforce Case [5007000000EWiLh]
        yip.ng made changes -
        Attachment CustomMessagesRenderer.java [ 12912 ]
        Hide
        yip.ng added a comment - - edited

        Order of registering renderers is: @FacesRenderer(), JSF, faces-config.xml. See screenshot 1.

        Therefore, declaration in @FacesRenderer() will be replaced by JSF declaration if renderer type id is the same. Therefore, must use faces-config.xml.

        Or, we can make (component family id + renderer type id) unique. However, because they are set in the component class (javax.faces.component.html.HtmlMessages), this is impossible without overriding the component class.

        Show
        yip.ng added a comment - - edited Order of registering renderers is: @FacesRenderer(), JSF, faces-config.xml. See screenshot 1. Therefore, declaration in @FacesRenderer() will be replaced by JSF declaration if renderer type id is the same. Therefore, must use faces-config.xml. Or, we can make (component family id + renderer type id) unique. However, because they are set in the component class (javax.faces.component.html.HtmlMessages), this is impossible without overriding the component class.
        yip.ng made changes -
        Attachment screenshot-01.png [ 12913 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #24081 Wed Mar 02 16:05:00 MST 2011 yip.ng ICE-6621: Message(s) rendering not overridable by application.
        Files Changed
        Commit graph MODIFY /icefaces2/trunk/icefaces/core/src/main/java/org/icefaces/impl/renderkit/DOMRenderKit.java
        Hide
        yip.ng added a comment -

        Delegate render kit in DOMRenderKit is always com.sun.faces.renderkit.RenderKitImpl.

        Show
        yip.ng added a comment - Delegate render kit in DOMRenderKit is always com.sun.faces.renderkit.RenderKitImpl.
        Hide
        Mark Collette added a comment -

        Probably not when with MyFaces 2 though, right?

        Show
        Mark Collette added a comment - Probably not when with MyFaces 2 though, right?
        yip.ng made changes -
        Attachment screenshot-02.png [ 12914 ]
        Hide
        yip.ng added a comment -

        With MyFaces, delegate is org.apache.myfaces.renderkit.html.HtmlRenderKitImpl.

        Show
        yip.ng added a comment - With MyFaces, delegate is org.apache.myfaces.renderkit.html.HtmlRenderKitImpl.
        yip.ng made changes -
        Attachment screenshot-03.png [ 12920 ]
        Hide
        yip.ng added a comment -

        With MyFaces, order of registering renderers is: JSF, faces-config.xml, @FacesRenderer(). See screenshot 3.

        Therefore, @FacesRenderer() should work.

        Show
        yip.ng added a comment - With MyFaces, order of registering renderers is: JSF, faces-config.xml, @FacesRenderer(). See screenshot 3. Therefore, @FacesRenderer() should work.
        Hide
        yip.ng added a comment - - edited

        Changed in DOMRenderKit from checking component family and renderer type ids ("javax.faces.Message") to checking renderer class name ("com.sun.faces.renderkit.html_basic.MessageRenderer".), i.e., only override with our renderer class ("org.icefaces.impl.renderkit.html_basic.MessageRenderer") when registered rendderer class is Mojarra class.

        Side effect: with MyFaces, the class name is "org.apache.myfaces.renderkit.html.HtmlMessageRenderer", so our override renderer class can't take over anymore.

        Same with MessagesRenderer.

        User-registered renderer works now provided user registers the renderer in the proper order mentioned above. See screenshot 2.

        Revision: 24081


        Modified : /icefaces2/trunk/icefaces/core/src/main/java/org/icefaces/impl/renderkit/DOMRenderKit.java

        Show
        yip.ng added a comment - - edited Changed in DOMRenderKit from checking component family and renderer type ids ("javax.faces.Message") to checking renderer class name ("com.sun.faces.renderkit.html_basic.MessageRenderer".), i.e., only override with our renderer class ("org.icefaces.impl.renderkit.html_basic.MessageRenderer") when registered rendderer class is Mojarra class. Side effect: with MyFaces, the class name is "org.apache.myfaces.renderkit.html.HtmlMessageRenderer", so our override renderer class can't take over anymore. Same with MessagesRenderer. User-registered renderer works now provided user registers the renderer in the proper order mentioned above. See screenshot 2. Revision: 24081 Modified : /icefaces2/trunk/icefaces/core/src/main/java/org/icefaces/impl/renderkit/DOMRenderKit.java
        yip.ng made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #24085 Thu Mar 03 11:39:36 MST 2011 arran.mccullough ICE-6621: Message(s) rendering not overridable by application
        Files Changed
        Commit graph MODIFY /icefaces2/scratchpads/patches/SF9769/icefaces/core/src/main/java/org/icefaces/impl/renderkit/DOMRenderKit.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #24086 Thu Mar 03 11:41:27 MST 2011 arran.mccullough ICE-6621: Message(s) rendering not overridable by application
        Files Changed
        Commit graph MODIFY /icefaces2/scratchpads/patches/SF9769/icefaces/core/src/main/java/org/icefaces/impl/renderkit/DOMRenderKit.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #24087 Thu Mar 03 11:44:26 MST 2011 arran.mccullough ICE-6621: Message(s) rendering not overridable by application
        Files Changed
        Commit graph MODIFY /icefaces2/scratchpads/patches/SF9769/icefaces/core/src/main/java/org/icefaces/impl/renderkit/DOMRenderKit.java
        Ken Fyten made changes -
        Component/s Framework [ 10013 ]
        Component/s Components [ 10012 ]
        Ken Fyten made changes -
        Assignee Priority P1
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            yip.ng
            Reporter:
            Mark Collette
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: