You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Martin U <uf...@googlemail.com> on 2010/03/18 14:19:04 UTC

Tree with invisible Nodes

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

Posted by MattyDE <uf...@gmail.com>.
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 <uf...@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-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@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-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Tree with invisible Nodes

Posted by Igor Vaynberg <ig...@gmail.com>.
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 <uf...@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-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


SV: Make FeedbackPanel occupy zero space when having no messages?

Posted by Wilhelmsen Tor Iver <To...@arrive.no>.
> How can I make FeedbackPanel occupy zero space when having no messages?

Override isVisible() to test if there are any messages to show, and call setOutputMarkupPlaceholder(true);

- Tor Iver

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


Re: Make FeedbackPanel occupy zero space when having no messages?

Posted by Matthias Keller <ma...@ergon.ch>.
Hi

Just create your own FeedbackPanel subclass and add:

     public boolean isVisible () {
         return anyMessage();
     }

Matt

On 2010-03-18 14:32, David Chang wrote:
> Hello, I am playing with FeedbackPanel. I put it in a page like this:
>
> <div wicket:id="feedbackHolder" />
>
> I notice that when having no messages, it always take up some space.
>
> How can I make FeedbackPanel occupy zero space when having no messages?
>
> Wicket way? or CSS?
>
> Any help is really appreciated.



Make FeedbackPanel occupy zero space when having no messages?

Posted by David Chang <da...@yahoo.com>.
Hello, I am playing with FeedbackPanel. I put it in a page like this:

<div wicket:id="feedbackHolder" />

I notice that when having no messages, it always take up some space.

How can I make FeedbackPanel occupy zero space when having no messages?

Wicket way? or CSS? 

Any help is really appreciated.

Regards.



      

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