ICEfaces
  1. ICEfaces
  2. ICE-9753

ace:menuItem as menuModel throws exception in ace:dataTable unless id's are all same

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: EE-3.3.0.GA_P01
    • Fix Version/s: 4.0.BETA, EE-3.3.0.GA_P02, 4.0
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      jsf 2 ace
    • Assignee Priority:
      P2
    • Salesforce Case Reference:

      Description

      Get exception ...will attach test case for ace components that can be built in QA checkout. THe page 12500Theirs is the original and 12500TheirsNoId.xhtml is the one that works (all menu items have same id)

      javax.faces.FacesException: Cannot add the same component twice: f:table:0:Item1_2
      at com.sun.faces.context.StateContext$AddRemoveListener.handleAddRemoveWithAutoPrune(StateContext.java:510)
      at com.sun.faces.context.StateContext$AddRemoveListener.handleAdd(StateContext.java:437)
      at com.sun.faces.context.StateContext$AddRemoveListener.processEvent(StateContext.java:359)
      at javax.faces.event.SystemEvent.processListener(SystemEvent.java:106)
      at com.sun.faces.application.ApplicationImpl.processListenersAccountingForAdds(ApplicationImpl.java:2212)
      at com.sun.faces.application.ApplicationImpl.invokeViewListenersFor(ApplicationImpl.java:2033)
      at com.sun.faces.application.ApplicationImpl.__publishEvent(ApplicationImpl.java:292)
      at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java)
      at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:247)
      at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2207)
      at javax.faces.component.UIComponentBase.doPostAddProcessing(UIComponentBase.java:1889)
      at javax.faces.component.UIComponentBase.setParent(UIComponentBase.java:406)
      at javax.faces.component.UIComponentBase$ChildrenList.add(UIComponentBase.java:2641)
      at javax.faces.component.UIComponentBase$ChildrenList.add(UIComponentBase.java:2613)
      at org.icefaces.ace.component.menu.AbstractMenu.buildMenuFromModel(AbstractMenu.java:49)
      at org.icefaces.ace.component.menu.MenuRenderer.encodeEnd(MenuRenderer.java:52)
      at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:881)
      at com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.encodeParentAndChildren(DomBasicRenderer.java:347)
      at com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.encodeParentAndChildren(DomBasicRenderer.java:342)
      at com.icesoft.faces.component.ext.renderkit.TableRenderer.encodeChildren(TableRenderer.java:902)
      at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:851)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1779)
      at javax.faces.render.Renderer.encodeChildren(Renderer.java:168)
      at org.icefaces.impl.renderkit.RendererWrapper.encodeChildren(RendererWrapper.java:49)
      at org.icefaces.impl.renderkit.RendererWrapper.encodeChildren(RendererWrapper.java:49)
      at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:851)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1779)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782)
      at org.icefaces.impl.context.DOMPartialViewContext.processPartial(DOMPartialViewContext.java:148)
      at javax.faces.component.UIViewRoot.encodeChildren(UIViewRoot.java:973)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1779)
      at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:413)
      at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:124)
      at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:286)
      at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:286)
      at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)

        Activity

        Hide
        Judy Guglielmin added a comment -

        test case for this Jira

        Show
        Judy Guglielmin added a comment - test case for this Jira
        Hide
        Judy Guglielmin added a comment -

        for targeting and assigning..

        Show
        Judy Guglielmin added a comment - for targeting and assigning..
        Hide
        Judy Guglielmin added a comment -

        tried this example with mojarra 2.1.25 and 2.1.26 and neither the user's test case (id's distinct for menuItems) nor mine (id's same for menuItems) work at all. Both cause same exception as 2.1.21 with User's test case. So this workaround is only good for 2.1.21 mojarra.

        Show
        Judy Guglielmin added a comment - tried this example with mojarra 2.1.25 and 2.1.26 and neither the user's test case (id's distinct for menuItems) nor mine (id's same for menuItems) work at all. Both cause same exception as 2.1.21 with User's test case. So this workaround is only good for 2.1.21 mojarra.
        Hide
        Ken Fyten added a comment -

        Assign to Mircea to evaluate why the newer Mojarra JSF 2.1.26 fails but earlier 2.1.21 sort of works. Possible JSF issue?

        Show
        Ken Fyten added a comment - Assign to Mircea to evaluate why the newer Mojarra JSF 2.1.26 fails but earlier 2.1.21 sort of works. Possible JSF issue?
        Hide
        Mircea Toma added a comment - - edited

        Modified AbstractMenu.buildMenuFromModel method to mark the menu component and its dynamically added children as not being part of the view while recreating the menu components. This is to avoid triggering the JSF component tree regeneration every time the method is invoked (multiple times per JSF cycle).

        Show
        Mircea Toma added a comment - - edited Modified AbstractMenu.buildMenuFromModel method to mark the menu component and its dynamically added children as not being part of the view while recreating the menu components. This is to avoid triggering the JSF component tree regeneration every time the method is invoked (multiple times per JSF cycle).
        Hide
        Cruz Miraback added a comment - - edited

        Confirmed fixed on ICEfaces4 trunk revision# 39497 using the test app provided. Testing with PARTIAL_STATE_SAVING=true/false with Mojarra 2.1.26 and MyFaces 2.1.12.

        Show
        Cruz Miraback added a comment - - edited Confirmed fixed on ICEfaces4 trunk revision# 39497 using the test app provided. Testing with PARTIAL_STATE_SAVING=true/false with Mojarra 2.1.26 and MyFaces 2.1.12.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: