I have figured out the considerable gyrations to subclass a LinkTree so its
leaves contain links that will change the page in another frame within a
frameset, and I'm doing this with regular Links (i.e., href and target
attributes, and setting the response page and the frame target's page class
from Link.onClick(), as Eelco does in his Frames example):

public class FrameLinkTree extends LinkTree 
{
    ...
    public MarkupContainer newLink( String strId, final HorizontalFrameset
frameset, final Class pageClass )
    {
        Link link = new Link( strId )
        {
            private static final long serialVersionUID = 1L;

            @Override
            public void onClick()
            {
                frameset.getFrameTarget().setFrameClass( pageClass );
                                
                // trigger re-rendering of the page
                setResponsePage( frameset );
            }
        };
        link.add( new SimpleAttributeModifier( "target", "_parent" ) );
        return link;
    }    
}

However, my pages need a parameter in their constructors, so I'll need to
pass that parameter from the link.  It looks like the only link type that
takes parameters is the BookmarkablePageLink.  I would use this class so I
could pass the parameters, only the BookmarkablePageLink doesn't use the
onClick().  There's a comment in the BookmarkablePageLink code that
BookmarkablePageLinks "are dispatched by the request handling servlet", so
there's no way I can override that.

So is there any way I can get a parameter on a Link, or is there any way I
can set the frame target and response page on a BookmarkablePageLink?

-- 
View this message in context: 
http://www.nabble.com/Links-with-CGI-parameters--tp19923784p19923784.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