I think you just have to toggle the operation (url ) and model object for
label
based on user is null or not.
Label dynamicText = new Label("lbl" , new AbstractReadOnlyModel(){

  public Object getObject(){

      User u = ...;
      if(u==null){

                return ""in order to sign in please click";
      }
     else{
             return hello   u.<get_name()>;

      }

 }
});

Similarly for link. just change the action in onClick for example

-swaroop


On 10/16/07, Cristi Manole <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I was wondering if it is possible to do custom rendering in wicket.
>
> What i need is something like a panel in which
> -> if the user is not logged in, there will be a text with "in order to
> sign
> in please click <<Sign in>>" and then the link and
> -> if the user is logged in, the same text component would show "hello
> <<user>>, please click <<Sign out>> in order to logout" and then the link.
>
> The point is having an anchor with different text and different target
> through code - one panel, not having two very similar panels.
>
> I didn't manage to get this custom functionality by having <a
> wicket:id=".."><span wicked:id=".."/></a>.
>
> Thank you.
>

Reply via email to