Uploaded image for project: 'MyFaces Tomahawk'
  1. MyFaces Tomahawk
  2. TOMAHAWK-671

Tree2 fails with NumberFormat Exception or Null Pointer Exception when ExpandAll button is placed in the same form as Tree2 using RI

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.1.4-SNAPSHOT
    • None
    • Tree2
    • None
    • WindowsXP, SUN JSF RI 1.1.02, Tomahawk 1.1.5

    Description

      When a button that executes HtmlTree.expandAll is put into the same <h:form> then the Tree2 component after clicking on the button Tree2 throws NumberFormat or NullPointer exception (depending on which build of Tomahawk is used).

      On our system I have fixed it with teh following code:

      package org.apache.myfaces.custom.tree2
      class UITreeData

      public void broadcast(FacesEvent event) throws AbortProcessingException
      {
      if (event instanceof FacesEventWrapper)

      { FacesEventWrapper childEvent = (FacesEventWrapper) event; String currNodeId = getNodeId(); setNodeId(childEvent.getNodeId()); FacesEvent nodeEvent = childEvent.getFacesEvent(); nodeEvent.getComponent().broadcast(nodeEvent); setNodeId(currNodeId); return; }

      else if(event instanceof ToggleExpandedEvent)
      {
      ToggleExpandedEvent toggleEvent = (ToggleExpandedEvent) event;

      if (toggleEvent.getNodeId() != null && !"null".equals(toggleEvent.getNodeId()))

      { String currentNodeId = getNodeId(); setNodeId(toggleEvent.getNodeId()); toggleExpanded(); setNodeId(currentNodeId); }

      }
      else

      { super.broadcast(event); return; }

      }

      The chanegd code first check if the node to be toggledis valid before it performs the toggle.

      Attachments

        1. UITreeData.patch
          0.8 kB
          Stan Laufik

        Activity

          People

            Unassigned Unassigned
            stanoislav Stan Laufik
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: