0

zk framework: how to load zul pages from WEB-INF under directory zul

asked 2013-07-01 07:49:21 +0800

qasibeat gravatar image qasibeat
12

Problem: I am working with ZK. Make a leaf node as tree-node and adding a leaf node to it.

My Solution I copy a target-leaf-node object and make it tree-node and then I add another dragged leaf-node to it. Then I remove the target leaf-node as it's not needed anymore.

Issue

My issue is that I am adding the newly created tree-node with leaf-node at the root level. Although I am able to get the path of the target leaf-node, where I want to create a new tree node, But I couldn't find any method in ZK which could help me there.

MyCode

Contact parentContact = parent.getData();
Contact contact = newNodes[0].getData();

parentContact.setCategory(parentContact.getName());
parentContact.setName(null);

TreeNode<Contact> treeNode =  new ContactTreeNode(parentContact,new ContactTreeNode[] {});


parent.getModel().getRoot().insert(treeNode, index);  //partially works

int[] path = parent.getModel().getPath(parent);

for(int p: path){
 System.out.println( p);
}

treeNode.getChildren().add(new ContactTreeNode(contact));

parent.removeFromParent();

thanks.

When I print path, it's obvious different for each node, but for reference it's like it.

0 0 1

I want to create a tree node on above path. Hope you could help me on this.

thanks

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-07-03 10:29:23 +0800

cor3000 gravatar image cor3000
6280 2 7

updated 2013-07-03 11:41:41 +0800

first I can't see a connection between the title and the content of your post, So I'll just concentrate on the content.

I am not entirely sure what you try to achieve so before I try to provide the wrong example can you please confirm I understood you correctly:

Do you want to replace an existing leaf-node in a tree with a tree-node that is not a leaf? And want to make sure it is inserted at the same position? Or what do you need the path for? Does ContactTreeNode extend DefaultTreeNode?

did you have a look at the dynamic tree example ?

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
2 followers

RSS

Stats

Asked: 2013-07-01 07:49:21 +0800

Seen: 35 times

Last updated: Jul 03 '13

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