ICEfaces
  1. ICEfaces
  2. ICE-4548

Handle additional cloneWithWriter cases

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Invalid
    • Affects Version/s: 2.0-Alpha1
    • Fix Version/s: 3.0
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      ICEfaces
    • Assignee Priority:
      P3

      Description


      The mojarra MenuRenderer contains the code below, which expects to ultimately render a String via a cloned ResponseWriter. This is a case that is currently not taken into account by the ResponseWriter "state machine". Ultimately, the component is simply requesting a writer to buffer its output, but this goes against the structured output we are looking for with D2D rendering. In this case, it means that the DOM diff will be unable to replace individual select items.

      The "fix" at the moment is to take a particular strategy based on the passed-in writer:

          public ResponseWriter cloneWithWriter(Writer writer) {
              if (writer.getClass().getName().endsWith("FastStringWriter")) {
                  return new BasicResponseWriter(writer, getContentType(), getCharacterEncoding());
              }

      This cannot be the ultimate solution as there is no guarantee on the Class name of the writer. A better approach will be to understand the patter of ResponsWriter constructions, potentially eliminating the WriteBehindResponseWriter.



              FastStringWriter bufferedWriter = new FastStringWriter(128);
              context.setResponseWriter(writer.cloneWithWriter(bufferedWriter));
              int count = renderOptions(context, component, items);
              context.setResponseWriter(writer);
              // If "size" is *not* set explicitly, we have to default it correctly
              Integer size = (Integer) component.getAttributes().get("size");
              if (size == null || size == Integer.MIN_VALUE) {
                  size = count;
              }
              writeDefaultSize(writer, size);

              RenderKitUtils.renderPassThruAttributes(context,
                                                      writer,
                                                      component,
                                                      ATTRIBUTES,
                                                      getNonOnChangeBehaviors(component));
              RenderKitUtils.renderXHTMLStyleBooleanAttributes(writer,
                                                               component);

              RenderKitUtils.renderOnchange(context, component);

              // Now, write the buffered option content
              writer.write(bufferedWriter.toString());

              writer.endElement("select");


        Activity

        Repository Revision Date User Message
        ICEsoft Public SVN Repository #18938 Fri May 29 10:11:18 MDT 2009 ted.goddard workaround for MenuRenderer (ICE-4548)
        Files Changed
        Commit graph MODIFY /icefaces/scratchpads/glimmer/core/src/main/java/org/icefaces/context/DOMResponseWriter.java
        Commit graph MODIFY /icefaces/scratchpads/glimmer/core/src/main/java/org/icefaces/context/BasicResponseWriter.java
        Ted Goddard created issue -
        Ted Goddard made changes -
        Field Original Value New Value
        Salesforce Case []
        Fix Version/s 2.0 [ 10032 ]
        Hide
        Ted Goddard added a comment -

        Only jsf-ri/src/com/sun/faces/renderkit/html_basic/MenuRenderer.java employs this technique.

        Show
        Ted Goddard added a comment - Only jsf-ri/src/com/sun/faces/renderkit/html_basic/MenuRenderer.java employs this technique.
        Ted Goddard made changes -
        Salesforce Case []
        Ken Fyten made changes -
        Fix Version/s 2.0-Alpha1 [ 10213 ]
        Fix Version/s 2.0-Beta [ 10032 ]
        Affects Version/s 2.0-Alpha1 [ 10213 ]
        Affects Version/s 2.0-Beta [ 10032 ]
        Ken Fyten made changes -
        Fix Version/s 2.0-Alpha2 [ 10214 ]
        Fix Version/s 2.0-Alpha1 [ 10213 ]
        Ken Fyten made changes -
        Fix Version/s 2.0-Beta [ 10032 ]
        Fix Version/s 2.0-Alpha2 [ 10214 ]
        Hide
        Ken Fyten added a comment -

        Is this still relevant?

        Show
        Ken Fyten added a comment - Is this still relevant?
        Ken Fyten made changes -
        Assignee Ted Goddard [ ted.goddard ]
        Ken Fyten made changes -
        Salesforce Case []
        Fix Version/s 2.0-Beta [ 10231 ]
        Fix Version/s 2.0-Alpha3 [ 10032 ]
        Hide
        Ken Fyten added a comment -

        The current fix is potentially fragile, needs review before final release.

        Show
        Ken Fyten added a comment - The current fix is potentially fragile, needs review before final release.
        Ken Fyten made changes -
        Salesforce Case []
        Fix Version/s 2.0.0 [ 10230 ]
        Fix Version/s 2.0-Beta [ 10231 ]
        Ken Fyten made changes -
        Salesforce Case []
        Assignee Priority P3
        Ken Fyten made changes -
        Salesforce Case []
        Fix Version/s 2.1 [ 10241 ]
        Fix Version/s 2.0.0 [ 10230 ]
        Hide
        Ken Fyten added a comment -

        Myfaces integration may force some changes to this approach.

        Show
        Ken Fyten added a comment - Myfaces integration may force some changes to this approach.
        Ken Fyten made changes -
        Salesforce Case []
        Assignee Ted Goddard [ ted.goddard ] Deryk Sinotte [ deryk.sinotte ]
        Deryk Sinotte made changes -
        Assignee Deryk Sinotte [ deryk.sinotte ] Jack van Ooststroom [ jack.van.ooststroom ]
        Hide
        Ken Fyten added a comment -

        Judging that further changes here are no longer required.

        Show
        Ken Fyten added a comment - Judging that further changes here are no longer required.
        Ken Fyten made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Invalid [ 6 ]

          People

          • Assignee:
            Jack Van Ooststroom
            Reporter:
            Ted Goddard
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: