ICEfaces
  1. ICEfaces
  2. ICE-1449

Tomahawk: t:inputCalendar proliferates commandLinks

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.6DR#3
    • Fix Version/s: 1.6DR#5, 1.6
    • Component/s: None
    • Labels:
      None
    • Environment:
      Tomahawk + Myfaces + ICEFaces

      Description

      Interaction with t:inputCalendar proliferates commandLinks when runing under ICEFaces.

        Issue Links

          Activity

          Hide
          Adnan Durrani added a comment -

          In renderResponsePhase the HtmlCalendarRenderer adds as many new commandLinks as number of days in a month to the HtmlCalendar component, and then delegates rendering to its children, but it never removes them back after completion of the rendering, which is fine with Myfaces but not if running with Myfaces + ICEFaces.

          As Myfaces creates a new component tree during restoreView, so there is always a new instance of HtmlCalendar component with no existing children, while ICEFaces maintains the component tree for optimization to reduce the latency, so under ICEFaces the previously created component instance being used and it gets duplicate children in each and every renderResponsePhase. That is why rendered page shows proliferated commandLinks.

          As decode() has been managed by the HtmlCalendarRenderer itself, and commandLinks never required by any other phases so it would be safe to remove them when rendering being completed. It would fix the problem with ICEFaces. The following is suggested change:

          HtmlCalendarRenderer.java

          public void encodeEnd(FacesContext facesContext, UIComponent component)
          throws IOException

          { ..... ...... //As inputCalendar component does not have any other child except the one created during renderResponsePhase //So it is safe to make the following call component.getChildren().removeAll(component.getChildren()); }

          The above change has been tested with Myfaces and Myfaces + ICEFaces and everything works fine.

          Show
          Adnan Durrani added a comment - In renderResponsePhase the HtmlCalendarRenderer adds as many new commandLinks as number of days in a month to the HtmlCalendar component, and then delegates rendering to its children, but it never removes them back after completion of the rendering, which is fine with Myfaces but not if running with Myfaces + ICEFaces. As Myfaces creates a new component tree during restoreView, so there is always a new instance of HtmlCalendar component with no existing children, while ICEFaces maintains the component tree for optimization to reduce the latency, so under ICEFaces the previously created component instance being used and it gets duplicate children in each and every renderResponsePhase. That is why rendered page shows proliferated commandLinks. As decode() has been managed by the HtmlCalendarRenderer itself, and commandLinks never required by any other phases so it would be safe to remove them when rendering being completed. It would fix the problem with ICEFaces. The following is suggested change: HtmlCalendarRenderer.java public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException { ..... ...... //As inputCalendar component does not have any other child except the one created during renderResponsePhase //So it is safe to make the following call component.getChildren().removeAll(component.getChildren()); } The above change has been tested with Myfaces and Myfaces + ICEFaces and everything works fine.
          Hide
          Adnan Durrani added a comment -

          Please see the following JIRA case for more detail:

          https://issues.apache.org/jira/browse/TOMAHAWK-968

          Show
          Adnan Durrani added a comment - Please see the following JIRA case for more detail: https://issues.apache.org/jira/browse/TOMAHAWK-968
          Hide
          Adnan Durrani added a comment -

          Myfaces applied our suggested patch as 17 May of 2007. I have tested it with tomahawk-1.1.6-SNAPSHOT and it is working fine.

          Show
          Adnan Durrani added a comment - Myfaces applied our suggested patch as 17 May of 2007. I have tested it with tomahawk-1.1.6-SNAPSHOT and it is working fine.

            People

            • Assignee:
              Unassigned
              Reporter:
              Adnan Durrani
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: