On 8/30/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> interface menuitem extends serializable { imodel getlabel(); abstract void
> onclick(); }
>
> class basepage extends webpage {
>   protected abstract list<menuitem> getitems();
>
>   public basepage() {
>       add(new listview("menu", new propertymodel(this, "items")) {
>             populateitems(item item) {
>                menuitem mi=item.getmodelobject();
>                link link=new link("link", item.getmodel()) {
>                    onclick() { ((menuitem)getmodelobject()).onclick(); }
>                }
>                item.add(link);
>                link.add(new label("label", mi.getlabel());
>              }
>          }
>    }

Or use bookmarkable links instead of normal links if e.g. you are
building a menu bar that needs to be clickable even if the session
expires.

Eelco

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

Reply via email to