Home Forums FlexGanttFX NullPointer when using CollapseOnce function of GanttChart with no loaded data

  • Author
    Posts
  • Felix
    Participant
    Post count: 5
    #13050 |

    When no data is loaded and I click on CollapseOnce, this exception is thrown:

    java.lang.NullPointerException
    com.flexganttfx.view.GanttChart.closeItem(GanttChart.java:801)
    com.flexganttfx.view.GanttChart.expandOrCollapseRows(GanttChart.java:752)
    com.flexganttfx.view.GanttChart.collapseRowsByOneLevel(GanttChart.java:738)
    com.flexganttfx.view.util.RowHeader.lambda$new$154(RowHeader.java:124)
    com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
    com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
    com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
    com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
    com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
    com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
    javafx.event.Event.fireEvent(Event.java:198)
    javafx.scene.control.MenuItem.fire(MenuItem.java:462)
    com.sun.javafx.scene.control.skin.ContextMenuContent$MenuItemContainer.doSelect(ContextMenuContent.java:1405)
    com.sun.javafx.scene.control.skin.ContextMenuContent$MenuItemContainer.lambda$createChildren$343(ContextMenuContent.java:1358)
    com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:218)
    com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
    com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
    com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
    com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
    com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
    com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
    com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
    javafx.event.Event.fireEvent(Event.java:198)
    javafx.scene.Scene$MouseHandler.process(Scene.java:3757)
    javafx.scene.Scene$MouseHandler.access$1500(Scene.java:3485)
    javafx.scene.Scene.impl_processMouseEvent(Scene.java:1762)
    javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2494)
    com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:352)
    com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:275)
    java.security.AccessController.doPrivileged(Native Method)
    com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$354(GlassViewEventHandler.java:388)
    com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389)
    com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:387)
    com.sun.glass.ui.View.handleMouseEvent(View.java:555)
    com.sun.glass.ui.View.notifyMouse(View.java:937)
    com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
    java.lang.Thread.run(Thread.java:745)

  • Dirk Lemmermann
    Keymaster
    Post count: 64
    #13051 |

    What exactly do you mean by “no loaded data”? There is no “root” set on the Gantt chart? Or the root has no children and root is not showing?

  • Felix
    Participant
    Post count: 5
    #13052 |

    I mean, that no data / rows / activities where added to the ganttChart, so its completely empty.
    Yes there is no root set.

  • Dirk Lemmermann
    Keymaster
    Post count: 64
    #13053 |

    The Gantt chart comes with a default root already set. Does this mean you called gantt.setRoot(null)?

  • Felix
    Participant
    Post count: 5
    #13054 |

    I’m sorry, i just checked my code, and there is a root set.

    I set the root row myself and also I set
    ganttChart.getRoot().setExpanded(true);
    ganttChart.getTreeTable().setShowRoot(false);

  • Dirk Lemmermann
    Keymaster
    Post count: 64
    #13055 |

    I can confirm that there is a bug. I have created a ticket for it and already fixed it. It will be part of version 1.7.

You must be logged in to reply to this topic.