see the "Link embedded in localized Label/Message?" thread
Cristi Manole wrote:
Thank you for your reply.
The text of the label is easy to change. I cannot find a method to change
the text of the anchor. That's my problem.
Is there a way to do that?
On 10/16/07, Swaroop Belur <[EMAIL PROTECTED]> wrote:
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.
--
http://www.ehour.nl/
http://blog.ehour.nl/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]