click-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bob Schellink <>
Subject Re: How to create simple anchor
Date Wed, 14 Apr 2010 10:50:30 GMT
Hi Haim,

On 14/04/2010 02:05, Haim Schindler wrote:
> *I need to dynamically create an html link that points to another page.
> Is this the way to do it ?

You can use a PageLink instead of a ActionLink to link to a Page directly.

> someLink.setActionListener(new ActionListener() {
>        public boolean onAction(Control source) {
>             String path = getContext().getPagePath(SomePage.class);
>             setRedirect(path);
>             return true;
>        }
> });
> *the problem with this is that it uses "Redirect" so two calls are
> issues to the server instead of one if I just generate the html link by
> myself.*

You could also use a "forward" instead of a "redirect", but that leave the browser URL referring
the previous page, which might not be what you want.

Your best bet is probably a PageLink.

kind regards


View raw message