Re: popup Tree node

2013-09-06 Thread Sven Meier

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  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){

PageParameterspars=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 
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-h...@wicket.apache.org





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




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



Re: popup Tree node

2013-09-06 Thread Piratenvisier

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){

PageParameterspars=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 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-h...@wicket.apache.org





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



Re: popup Tree node

2013-09-05 Thread Sven Meier

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 
tree, IModel model)

{
  return new Folder(id, tree, model)
  {
@Override
protected MarkupContainer newLinkComponent(String id, IModel 
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-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org




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



Re: popup Tree node

2013-09-05 Thread Martin Grigorov
By giving us more details what you need :-)


On Thu, Sep 5, 2013 at 3: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-h...@wicket.apache.org
>
>