A Tree that creates its branch ondemand

asked 2006-11-28 10:38:44 +0800

admin gravatar image admin
18691 1 10 129
ZK Team

Orignial message at:

By: brsmrk

this is my scenario and problem:
I want to create a browsable Tree. In other word, each time I open (onOpen) a branch I havof my tree, I'd like it generate automatically its sub-branch.
How can I set dinaically, the attribute onOpen in order to assign a function to it? Below you can see the axample that doesn't work:
<tree width="100%">
<treeitem open="false" onOpen="doSomething()" >
<custom-attributes name="myListName">default</custom-attributes>
<treecell label="pluto"/>
<!--Content will be dynamically added in user event handler.-->
void doSomething() {
Treechildren tc = self.getTreechildren();
String myListName = (String)self.getAttribute("myListName");
if(myListName == null) myListName="default";
String[] myList = my.package.and.Class.getList();
for(String item : myList){
Treeitem ti = new Treeitem();

//I think that miss something like

Treechildren tcc = new Treechildren();

Thank you for your help.

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2006-11-28 12:36:49 +0800

admin gravatar image admin
18691 1 10 129
ZK Team

Orignial message at:

By: brsmrk

Ok! I found the solution.

link publish delete flag offensive edit

answered 2011-08-14 22:14:00 +0800

cyhsiao gravatar image cyhsiao

I have the same problem.
What's the solution?

link publish delete flag offensive edit

answered 2011-08-24 05:27:50 +0800

vincentjian gravatar image vincentjian
2245 6

updated 2011-08-24 05:28:04 +0800

The sample code works for me in ZK, do you still see a problem. If so, would you please post your sample code for test.

link publish delete flag offensive edit
Your reply
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




Asked: 2006-11-28 10:38:44 +0800

Seen: 417 times

Last updated: Aug 24 '11

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