You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Piratenvisier <ha...@yahoo.de> on 2013/09/05 14:02:27 UTC
popup Tree node
How can I make a tree node popup on click ?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: popup Tree node
Posted by Sven Meier <sv...@meiers.net>.
Well, just take your code from here:
http://apache-wicket.1842946.n4.nabble.com/Tree-with-different-BookmarkablePageLink-per-Node-tp4660096p4660103.html
... and use an AjaxLink to represent the content of a node:
public Component newContentComponent(String id, final AbstractTree<Foo>
tree, IModel<Foo> model)
{
return new Folder<Foo>(id, tree, model)
{
@Override
protected MarkupContainer newLinkComponent(String id, IModel<Foo>
model)
{
Foo foo = model.getObject();
return new AjaxLink(id) {
public void onClick(AjaxRequestTarget art) {
// show a div or open a modal dialog or ...
}
};
}
};
}
Sven
On 09/05/2013 02:02 PM, Piratenvisier wrote:
> How can I make a tree node popup on click ?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: popup Tree node
Posted by Sven Meier <sv...@meiers.net>.
Hi,
so you want the new page to be opened in a new browser window?
Then you have to override #newNodeLink() and add a "target" attribute to
the <a> tag (e.g. via an AttributeModifier).
Regards
Sven
On 09/06/2013 09:59 AM, Piratenvisier wrote:
> This is an application in my 1.5 wicket production application
> Version 6.9 is with a lot of annotations using appfuse is still in
> evaluation mode
> final Tree tree = new Tree("tree", treeModel)
> {
> @Override
> protected String renderNode(TreeNode node)
> {
> DefaultMutableTreeNode treeNode =
> (DefaultMutableTreeNode)node;
> Object userObject = treeNode.getUserObject();
> if (userObject instanceof Something) return
> ((Something)userObject).getSomething();
>
>
>
>
> }
> @Override
> protected void onNodeLinkClicked(AjaxRequestTarget
> target, TreeNode node) {
> if (((DefaultMutableTreeNode)
> node).getUserObject() instanceof Something) {
> PageParameters pars=new PageParameters();
> pars.add("context", "blind");
> pars.add("objid",((Something)((DefaultMutableTreeNode)
> node).getUserObject()).getSomething().getId());
> // This should popup in a new window
> setResponsePage(Some.class,pars);
> }
> };
>
> Am 05.09.2013 14:09, schrieb Martin Grigorov:
>> By giving us more details what you need :-)
>>
>>
>> On Thu, Sep 5, 2013 at 3:02 PM, Piratenvisier
>> <ha...@yahoo.de>wrote:
>>
>>> How can I make a tree node popup on click ?
>>>
>>> ------------------------------**------------------------------**---------
>>>
>>> To unsubscribe, e-mail:
>>> users-unsubscribe@wicket.**apache.org<us...@wicket.apache.org>
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: popup Tree node
Posted by Piratenvisier <ha...@yahoo.de>.
This is an application in my 1.5 wicket production application
Version 6.9 is with a lot of annotations using appfuse is still in
evaluation mode
final Tree tree = new Tree("tree", treeModel)
{
@Override
protected String renderNode(TreeNode node)
{
DefaultMutableTreeNode treeNode =
(DefaultMutableTreeNode)node;
Object userObject = treeNode.getUserObject();
if (userObject instanceof Something) return
((Something)userObject).getSomething();
}
@Override
protected void onNodeLinkClicked(AjaxRequestTarget
target, TreeNode node) {
if (((DefaultMutableTreeNode) node).getUserObject()
instanceof Something) {
PageParameters pars=new PageParameters();
pars.add("context", "blind");
pars.add("objid",((Something)((DefaultMutableTreeNode)
node).getUserObject()).getSomething().getId());
// This should popup in a new window
setResponsePage(Some.class,pars);
}
};
Am 05.09.2013 14:09, schrieb Martin Grigorov:
> By giving us more details what you need :-)
>
>
> On Thu, Sep 5, 2013 at 3:02 PM, Piratenvisier <ha...@yahoo.de>wrote:
>
>> How can I make a tree node popup on click ?
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<us...@wicket.apache.org>
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: popup Tree node
Posted by Martin Grigorov <mg...@apache.org>.
By giving us more details what you need :-)
On Thu, Sep 5, 2013 at 3:02 PM, Piratenvisier <ha...@yahoo.de>wrote:
> How can I make a tree node popup on click ?
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<us...@wicket.apache.org>
> For additional commands, e-mail: users-help@wicket.apache.org
>
>