Hi all,

I have a link which, depending on certain conditions, I need unlinked (ie disabled).

//link (if allowed, or none, just the label)
Link link = new Link("link") {

        public void onClick() {
                setResponsePage(new ViewProfile((String)getModelObject()));
        }
};
                                
//
if(isAllowed) {
        link.setModel(new Model(someValue));
} else {
        link.setEnabled(false);
}
                                
                                
link.add(new Label("label", labelValue));
item.add(link);


with simple markup:
<a href="#" wicket:id="link"><span wicket:id="label">[label]</span></a>


The problem is that link.setEnabled(false) adds <em> tags around my link:
output:
<span><em><span>this is the label</span></em></span>

Is there another way of disabling a link, or removing these em tags. Or even adding the link dynamically and having a normal label when there is to be no link?


cheers,
Steve

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to