You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "em@nuele" <em...@gmail.com> on 2008/03/27 16:24:13 UTC
Add different component for treenode
Hi,
with newNodeComponent in the BaseTree class i can specify a different
component for my treenode, but this is the same for all node. Is it possible
setting different treenode component for added a different type of node in
my tree?
something like this:
protected Component newNodeComponent(String id, IModel model) {
if( node type a)
return new component_a(id, model, tree);
else if
return new component_b(id, model, tree);
else
return new component_c(id, model, tree);
}
is it possible?
thk
Re: Add different component for treenode
Posted by vishy_sb <sh...@gmail.com>.
Nevermind I was able to get it to work
vishy
em@nuele wrote:
>
> Hi,
>
> with newNodeComponent in the BaseTree class i can specify a different
> component for my treenode, but this is the same for all node. Is it
> possible
> setting different treenode component for added a different type of node in
> my tree?
>
> something like this:
>
> protected Component newNodeComponent(String id, IModel model)
> {
> if( node type a)
> return new component_a(id, model, tree);
> else if
> return new component_b(id, model, tree);
> else
> return new component_c(id, model, tree);
> }
>
> is it possible?
>
> thk
>
>
--
View this message in context: http://www.nabble.com/Add-different-component-for-treenode-tp16332161p18786985.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: Add different component for treenode
Posted by vishy_sb <sh...@gmail.com>.
Hi em@nuele,
I am trying to get the same thing working here and was just wondering if you
were able to get it to work. if you did can you provide some help on you did
it. Also when I try to write the newNodeComponent() method just as you have
used below I get an exception that the method should return a value of type
component.
Any kind of help will be highly appreciated.
Thanks,
Vishy
em@nuele wrote:
>
> Hi,
>
> with newNodeComponent in the BaseTree class i can specify a different
> component for my treenode, but this is the same for all node. Is it
> possible
> setting different treenode component for added a different type of node in
> my tree?
>
> something like this:
>
> protected Component newNodeComponent(String id, IModel model)
> {
> if( node type a)
> return new component_a(id, model, tree);
> else if
> return new component_b(id, model, tree);
> else
> return new component_c(id, model, tree);
> }
>
> is it possible?
>
> thk
>
>
--
View this message in context: http://www.nabble.com/Add-different-component-for-treenode-tp16332161p18784879.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: Add different component for treenode
Posted by Igor Vaynberg <ig...@gmail.com>.
i dont see why not. model.getobject() will get you the treenode, which
you can cast down to your impl which will have a type property....
-igor
On Thu, Mar 27, 2008 at 8:24 AM, em@nuele <em...@gmail.com> wrote:
> Hi,
>
> with newNodeComponent in the BaseTree class i can specify a different
> component for my treenode, but this is the same for all node. Is it possible
> setting different treenode component for added a different type of node in
> my tree?
>
> something like this:
>
> protected Component newNodeComponent(String id, IModel model) {
> if( node type a)
> return new component_a(id, model, tree);
> else if
> return new component_b(id, model, tree);
> else
> return new component_c(id, model, tree);
> }
>
> is it possible?
>
> thk
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org