Perhaps just a helper method somewhere?
public AbstractLink addTitle(AbstractLink link, IModel<String> titleModel)
{
link.add(new AttributeModifier("title", true, titleModel));
return link;
}
On Tue, Oct 28, 2008 at 11:03 AM, Erik van Oosten <[EMAIL PROTECTED]> wrote:
>
> The following extends Link to have a title model in the constructor. Its easy
> to do the same for an ExternalLink.
>
> public abstract class TitledLink extends Link {
>
> public TitledLink(String id, String title) {
> this(id, new Model<String>(title));
> }
>
> public TitledLink(String id, IModel<String> titleModel) {
> super(id);
> add(new AttributeModifier("title", true, titleModel));
> }
>
> }
>
>
>
> Steve Swinsburg-2 wrote:
>>
>>
>> Hi all,
>>
>> I've just noticed a deficiency in the ExternalLink component that
>> doesn't allow a 'title' field to be set in its constructor. This is a
>> basic HTML attribute that all links should have (for accessibility and
>> expected behaviour).
>>
>> Currently this is only achieved by using AttributeAppender and setting
>> the title attribute onto the link component. I propose a new
>> construcotr that takes the title attribute as a parameter (or the
>> ExternalLink set a title by default).
>>
>> I have filed a Jira ticket here:
>> https://issues.apache.org/jira/browse/WICKET-1878
>>
>>
>> cheers,
>> Steve
>>
>>
>
> --
> View this message in context:
> http://www.nabble.com/no-title-in-ExternalLink-tp20030239p20208934.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]