Hi!

I have a web application that required to use frames.
It should display different frames depending on tree node clicks.
To achieve this I took the Frames example from wicket examples and added a
Tree component to the left frame of it and tried to change the right panel
depending on clicked nodes.

According to the examples the the parent="_target" attribute has to be set
on every link.
So wrote the following code that does exactly this:

@Override
protected void populateTreeItem(WebMarkupContainer item, int level) {
    super.populateTreeItem(item, level);
    item.visitChildren(Link.class, new IVisitor()
    {
        public Object component(Component component)
        {
            component.add(new SimpleAttributeModifier("target", "_parent"));
            return IVisitor.CONTINUE_TRAVERSAL;
        }
    });                                 
}

Also set LinkType property to of Tree to LinkType.REGULAR to make it work
(did not work with AJAX links).

Then overriden the onNodeClicked method with this code:
    bodyFrame.getFrameTarget().setFrameClass(showFrame);
    // trigger re-rendering of the page
    setResponsePage(bodyFrame);

Now on the first click the right frame disappears then on the second click
the upper frame disappears and the right is displayed.

Can someone tell me how to fix this or provide an example that works.
Thanks.
Bye
Kone

-- 
View this message in context: 
http://www.nabble.com/Frames-with-Tree-component-tp15702557p15702557.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to