Hi;

I wanted to do something easy, which is I wanted to have a link that
do some action by overriding onClick, but after the action is done, I
don't want only to refresh the page I want it to jump to an Anchor in
the same page.

while this is easy, it involved hard code the anchor name in java
code, so what I did is:

@Override
protected String getURL() {
        String url = super.getURL() + "#someWhereInThePage";
        return url;
}

What I would suggest is to check the link href attribute, if the
attribute has something behind # then it should do the above in the
getURL of the super class, if the href has nothing or only #, it
should not, so simple but I guess it's more wicket sense than what I'm
doing now :)

Hope you like it.

P.S: Yah! Yah! Yah!

@Override
protected String getURL() {
        BufferString url = new BufferString(super.getURL());
        url.append("#someWhereInThePage");
        return url.toString();
}

:) just joking!

--
Regards, Ali


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to