0

SimpleTreeModel

asked 2017-10-26 18:40:06 +0800

MaxJava gravatar image MaxJava
1

updated 2017-10-26 18:52:37 +0800

hello everyone i have this scenario:

  1. 1 tree (simpletreemodel)
  2. listbox

i would like drag listitem of my listbox in tree to build it. when i drop listitem in tree fires event but get object dragged empty maybe it happens because i have 2 different component

public void onEvent(Event event) throws Exception {
    if (event instanceof DropEvent) {
        DropEvent de = (DropEvent) event;
        ListItem item = (ListItem) de.getDragged();

got item null

delete flag offensive retag edit

Comments

can you reproduce this in a fiddle and post fiddle link here?

chillworld ( 2018-01-24 18:23:13 +0800 )edit

1 Answer

Sort by ยป oldest newest most voted
-1

answered 2018-01-24 17:36:54 +0800

mutandaoscura gravatar image mutandaoscura
1 1

I think u can add the selected item to the tree and remove it from the list like:

public void onEvent(@BindingParam("event") final Event event)
{
  treeModel.add(event)
  listModel.remove(event)
}
link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2017-10-26 18:40:06 +0800

Seen: 4 times

Last updated: Jan 24 '18

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More