Uploaded image for project: '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
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: 3.0.0
    • Fix Version/s: 3.0.1
    • Component/s: None
    • Labels:
      None
    • Environment:
      Using Myfaces 1.1.5, RichFaces 3.0.0, Ajax4JSF 1.1.0

      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.

        Gliffy Diagrams

          Activity

          Hide
          byarger 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
          byarger 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
          SergeySmirnov Sergey Smirnov added a comment -

          fixed in 3.0.1

          Show
          SergeySmirnov Sergey Smirnov added a comment - fixed in 3.0.1

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development