Re: Tree with invisible Nodes

2010-03-19 Thread MattyDE

Thanks igor for your Contribution.

I did it now with my own TreeNode-Type and my own
AbstractTree-Implementation:

@Override
protected void populateTreeItem(WebMarkupContainer item, int level) {   

super.populateTreeItem(item, level);

//Is this Node visible or not?
item.add(
new AbstractBehavior() {
@Override
public void onComponentTag(Component component, 
ComponentTag tag) {
TreeNode node = 
(TreeNode)component.getDefaultModelObject();
if(!node.isVisible()){
tag.put(class, ( 
tag.getString(class) +  hidden) );
}
}
}
);
} 


igor.vaynberg wrote:
 
 filter them in your TreeModel, it should work. you also have to
 override getChildCount() to return a count without filtered children,
 and adjust TreeModel#getIndexOfChild() to skip over the filtered
 children.
 
 -igor
 
 On Thu, Mar 18, 2010 at 6:19 AM, Martin U ufer.mar...@googlemail.com
 wrote:
 Hi Folks,

 i've to implement a tree in which some node are exists under a parent
 node
 but they should not be visible to the user in browser at all.

 I tried to overwrite getChild from TreeNode. But it dont works for me.
 I
 need this node existens either they are not visible because the tree is
 my
 data(model)-holder too for further processing


 Any Ideas?

 Thanks a lot.

 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

-- 
View this message in context: 
http://old.nabble.com/Tree-with-invisible-Nodes-tp27945428p27950906.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Tree with invisible Nodes

2010-03-18 Thread Martin U
Hi Folks,

i've to implement a tree in which some node are exists under a parent node
but they should not be visible to the user in browser at all.

I tried to overwrite getChild from TreeNode. But it dont works for me. I
need this node existens either they are not visible because the tree is my
data(model)-holder too for further processing


Any Ideas?

Thanks a lot.


Re: Tree with invisible Nodes

2010-03-18 Thread Igor Vaynberg
filter them in your TreeModel, it should work. you also have to
override getChildCount() to return a count without filtered children,
and adjust TreeModel#getIndexOfChild() to skip over the filtered
children.

-igor

On Thu, Mar 18, 2010 at 6:19 AM, Martin U ufer.mar...@googlemail.com wrote:
 Hi Folks,

 i've to implement a tree in which some node are exists under a parent node
 but they should not be visible to the user in browser at all.

 I tried to overwrite getChild from TreeNode. But it dont works for me. I
 need this node existens either they are not visible because the tree is my
 data(model)-holder too for further processing


 Any Ideas?

 Thanks a lot.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org