Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 1.5.3
    • Fix Version/s: 1.8.1
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      any

      Description

      When command link set as a content of the tree node and action listener is used to catch events, getting parent node always returns reference to the last node of the tree and not the node which was clicked.

        Issue Links

          Activity

          Hide
          Mark Collette added a comment -

          Ignore the last comment - it was for ICE-1745.

          Show
          Mark Collette added a comment - Ignore the last comment - it was for ICE-1745 .
          Hide
          Mark Collette added a comment -

          According to Adnan, who said that he looked into how the stock JSF component handle this, they queue the events as well, and so would not have access to the source UIComponent while it's still setup as with the proper clientId and submittedValue.

          Show
          Mark Collette added a comment - According to Adnan, who said that he looked into how the stock JSF component handle this, they queue the events as well, and so would not have access to the source UIComponent while it's still setup as with the proper clientId and submittedValue.
          Hide
          Sheng Gu added a comment -

          This bug can be fixed if add setCurrentVarToRequestMap(getFacesContext(), eventNode); code in broadcast method as follows:

          public void broadcast(FacesEvent event) throws AbortProcessingException {

          if (!(event instanceof NodeEvent))

          { super.broadcast(event); return; }

          // Set up the correct context and fire our wrapped event
          NodeEvent wrapperEvent = (NodeEvent) event;
          DefaultMutableTreeNode eventNode = wrapperEvent.getNode();
          this.setCurrentNode(eventNode);
          this.setNodePath(TreeRenderer.getPathAsString(eventNode,
          (DefaultMutableTreeNode) getModel()
          .getRoot()));

          //fix ICE-1409 bug
          setCurrentVarToRequestMap(getFacesContext(), eventNode);

          FacesEvent facesEvent = wrapperEvent.getFacesEvent();
          facesEvent.getComponent().broadcast(facesEvent);
          }

          Show
          Sheng Gu added a comment - This bug can be fixed if add setCurrentVarToRequestMap(getFacesContext(), eventNode); code in broadcast method as follows: public void broadcast(FacesEvent event) throws AbortProcessingException { if (!(event instanceof NodeEvent)) { super.broadcast(event); return; } // Set up the correct context and fire our wrapped event NodeEvent wrapperEvent = (NodeEvent) event; DefaultMutableTreeNode eventNode = wrapperEvent.getNode(); this.setCurrentNode(eventNode); this.setNodePath(TreeRenderer.getPathAsString(eventNode, (DefaultMutableTreeNode) getModel() .getRoot())); //fix ICE-1409 bug setCurrentVarToRequestMap(getFacesContext(), eventNode); FacesEvent facesEvent = wrapperEvent.getFacesEvent(); facesEvent.getComponent().broadcast(facesEvent); }
          Hide
          Mark Collette added a comment -

          Looks legitimate.

          Show
          Mark Collette added a comment - Looks legitimate.
          Hide
          Mark Collette added a comment -

          When I tried to reproduce this issue, I could not. The code looked like it was already covering this scenario. When I investigated the svn history of the code, I found that it had been fixed by ICE-2018.

          Show
          Mark Collette added a comment - When I tried to reproduce this issue, I could not. The code looked like it was already covering this scenario. When I investigated the svn history of the code, I found that it had been fixed by ICE-2018 .

            People

            • Assignee:
              Mark Collette
              Reporter:
              Philip Breau
            • Votes:
              10 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: