0

Removing Treeitem from Tree problem

asked 2007-09-12 09:27:27 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4514087

By: seacatseal

Attempt to remove node(Treeitem) from Tree, I was getting problem: "Failed to process outer.
Object required". What is it method of resolving?

delete flag offensive retag edit

4 Replies

Sort by ยป oldest newest

answered 2007-09-12 09:52:08 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4514128

By: waterbottle

Hi,
Could provide a reproducible code?
I can run following remove tree item code without any error,

<window title="tree demo" border="normal"> <button label="click me"> <attribute name="onClick"> t1.detach(); </attribute> </button>
<tree id="tree" width="90%" rows="5">
<treecols sizable="true">
<treecol label="Name"/>
<treecol label="Description"/>
</treecols>
<treechildren>
<treeitem id="t1">
<treerow>
<treecell label="Item 1"/>
<treecell label="Item 1 description"/>
</treerow>
</treeitem>
<treeitem>
<treerow>
<treecell label="Item 2"/>
<treecell label="Item 2 description"/>
</treerow>
<treechildren>
<treeitem>
<treerow>
<treecell label="Item 2.1"/>
</treerow>
</treeitem>
</treechildren>
</treeitem>
</treechildren>
</tree>
</window>

/Dennis

link publish delete flag offensive edit

answered 2007-09-12 12:14:54 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4514289

By: seacatseal

Zkoss lib version 2.4.1
I am use following code:
serviceRoot = this.getTreechildren();
List<AbstractComponent> listChildNodes = new LinkedList<AbstractComponent>();
for ( Object component : serviceRoot.getChildren() )
{
listChildNodes.add( (AbstractComponent) component );
}
for ( AbstractComponent child : listChildNodes )
{
serviceRoot.removeChild( child );
}


Problem obtains in line serviceRoot.removeChild(child).
child.detach() getting same result.


link publish delete flag offensive edit

answered 2007-09-26 01:18:41 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4537522

By: jebberwocky

Dear Seacat

I tried the code u provide. It runs fine without the exception you mentioned.
Could you provide more information or complete code of the program?

//JEFF

link publish delete flag offensive edit

answered 2012-01-10 13:16:09 +0800

AmandeepJ gravatar image AmandeepJ
15 1

hi,

you can try using. treeitem.detach();

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

Follow

RSS

Stats

Asked: 2007-09-12 09:27:27 +0800

Seen: 477 times

Last updated: Jan 10 '12

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