You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Chuck Brinkman <ch...@gmail.com> on 2010/01/10 04:46:37 UTC

how to change BookmarkablePageLink label

I want a link that changes based on a users attribute.  As the 'linked to'
page changes I want the displayed label to reflect the change.  I have
created two links and am setting visibility based on the users attribute.
This works but I think a better solution would be to just change the label
however this doesn't seem to be easily done.  My guess is I'm just not
looking in the right place.  Can someone show me the way.  Thanks.

Re: how to change BookmarkablePageLink label

Posted by Chuck Brinkman <ch...@gmail.com>.
Thanks,  I was thinking of the link as a single widget not a a link with a
label.  This seems to work.

                    <div id="logInOut" name="logInOut">
                        <a href="#" wicket:id="logInOutLink"><span
wicket:id="logInOutLabel"></span></a>
                    </div>


            if(UserHelper.get().isGuest(dis.getUser())) {
                BookmarkablePageLink bpl = new
BookmarkablePageLink("logInOutLink" , Login.class);
                add(bpl) ;
                bpl.add(new Label("logInOutLabel", "Login"));

            } else {
                BookmarkablePageLink bpl = new
BookmarkablePageLink("logInOutLink" , Logout.class);
                add(bpl) ;
                bpl.add(new Label("logInOutLabel", "Logout"));
            }

On Sat, Jan 9, 2010 at 11:31 PM, Igor Vaynberg <ig...@gmail.com>wrote:

> give the label a model that can dynamically change the value
>
> -igor
>
> On Sat, Jan 9, 2010 at 7:46 PM, Chuck Brinkman <ch...@gmail.com>
> wrote:
> > I want a link that changes based on a users attribute.  As the 'linked
> to'
> > page changes I want the displayed label to reflect the change.  I have
> > created two links and am setting visibility based on the users attribute.
> > This works but I think a better solution would be to just change the
> label
> > however this doesn't seem to be easily done.  My guess is I'm just not
> > looking in the right place.  Can someone show me the way.  Thanks.
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: how to change BookmarkablePageLink label

Posted by Igor Vaynberg <ig...@gmail.com>.
give the label a model that can dynamically change the value

-igor

On Sat, Jan 9, 2010 at 7:46 PM, Chuck Brinkman <ch...@gmail.com> wrote:
> I want a link that changes based on a users attribute.  As the 'linked to'
> page changes I want the displayed label to reflect the change.  I have
> created two links and am setting visibility based on the users attribute.
> This works but I think a better solution would be to just change the label
> however this doesn't seem to be easily done.  My guess is I'm just not
> looking in the right place.  Can someone show me the way.  Thanks.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org