RichFaces
  1. RichFaces
  2. RF-24

NPE from Drag/Drop Support classes if a component is added, then removed from a UIComponent children collection

    Details

    • Type: Bug Bug
    • Status: Closed Closed (View Workflow)
    • Priority: Minor Minor
    • Resolution: Done
    • Affects Version/s: 3.0.0
    • Fix Version/s: 3.0.1
    • Component/s: None
    • Security Level: Public (Everyone can see)
    • Labels:
      None
    • Environment:
      Using Myfaces 1.1.5, RichFaces 3.0.0, Ajax4JSF 1.1.0
    • Similar Issues:
      Show 10 results 

      Description

      When adding drag/drop support programmatically to some HtmlPanelGrids I had a situation where DragSupport was added to a panelGrid, but later on in the code the panelGrid's children were cleared and replaced with other components. When this happens with either HtmlDragSupport or HtmlDropSupport a NullPointerException is thrown from

      org.richfaces.component.UIDragSupport.getEventHandler(UIDragSupport.java:110)

      I've attached a WAR file with source that demonstrates this problem. I was able to work around it once I figured out what was going on, but it should be a valid thing to do without the NPE.

        Activity

        Hide
        Brian Yarger
        added a comment -

        A simple WAR file that demonstrates the problem. If you remove the call to getChildren().clear() the code works as expected. Once a call to clear() is made after Drag/Drop support is added it always throws the NPE.

        Show
        Brian Yarger
        added a comment - A simple WAR file that demonstrates the problem. If you remove the call to getChildren().clear() the code works as expected. Once a call to clear() is made after Drag/Drop support is added it always throws the NPE.
        Hide
        Sergey Smirnov
        added a comment -

        fixed in 3.0.1

        Show
        Sergey Smirnov
        added a comment - fixed in 3.0.1

          People

          • Assignee:
            Alexander Francuzov
            Reporter:
            Brian Yarger
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: