setEnabled() adds markup. Another way of disabling a link?

2009-01-16 Thread Steve Swinsburg
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())); } };

Re: setEnabled() adds markup. Another way of disabling a link?

2009-01-16 Thread James Carman
Override isVisible()? Or, do you want it to show text, just not be clickable? On Fri, Jan 16, 2009 at 12:51 PM, Steve Swinsburg s.swinsb...@lancaster.ac.uk wrote: Hi all, I have a link which, depending on certain conditions, I need unlinked (ie disabled). //link (if allowed, or none, just

Re: setEnabled() adds markup. Another way of disabling a link?

2009-01-16 Thread Steve Swinsburg
Yeah It needs to show the label and not be clickable if there is no link, or link and the label if there is to be a link e.g. in Facebook, a search shows a user's name but it may or may not be clickable depending on their privacy settings. thanks, Steve On 16 Jan 2009, at 17:54,

Re: setEnabled() adds markup. Another way of disabling a link?

2009-01-16 Thread Matthew Hanlon
Check out AbstractLink#setBeforeDisabledLink() and AbstractLink#setAfterDisabledLink(). I believe you can set the markup you want to appear there. This defaults to em. Or just go directly to AbstractLink#disableLink() and get the behaviour you want there. I think you can also do it application

Re: setEnabled() adds markup. Another way of disabling a link?

2009-01-16 Thread Steve Swinsburg
Thanks, this did the trick: getMarkupSettings().setDefaultBeforeDisabledLink(null); getMarkupSettings().setDefaultAfterDisabledLink(null); cheers, Steve On 16 Jan 2009, at 18:05, Matthew Hanlon wrote: Check out AbstractLink#setBeforeDisabledLink() and AbstractLink#setAfterDisabledLink().