[ 
https://issues.apache.org/jira/browse/WICKET-3338?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Willis Blackburn updated WICKET-3338:
-------------------------------------

    Description: 
This pattern occurs so frequently that Wicket should support it directly:

Link myLink = new Link("myLink") { ... }
myLink.add(new Label("my Label", "A Link"));
add(myLink);

becomes:

LabelLink myLink = new LabelLink("myLink", "A Link");

Obviously the second parameter could be a string or an iModel<?> that would be 
converted to a string.

I see that there have been some discussions about this before;  unfortunately 
apparently the thread has been deleted.  But whatever arguments there are 
against LabelLink are IMHO defeated by the fact that ExternalLink *does* have a 
label model!  So why are labels okay for external links but not for internal 
links?

I actually think that ExternalLink should have its label removed;  there are 
many cases in which external links do not have labels, and this would save 
several bytes per label.  But there should be a LabelExternalLink as well.



  was:
This pattern occurs so frequently that Wicket should support it directly:

Link myLink = new Link("myLink") { ... }
myLink.add(new Label("my Label", "A Link"));
add(myLink);

becomes:

LabelLink myLink = new Link("myLink", "A Link");

Obviously the second parameter could be a string or an iModel<?> that would be 
converted to a string.

I see that there have been some discussions about this before;  unfortunately 
apparently the thread has been deleted.  But whatever arguments there are 
against LabelLink are IMHO defeated by the fact that ExternalLink *does* have a 
label model!  So why are labels okay for external links but not for internal 
links?

I actually think that ExternalLink should have its label removed;  there are 
many cases in which external links do not have labels, and this would save 
several bytes per label.  But there should be a LabelExternalLink as well.




Corrected a typo.

> Please provide a LabelLink or something similar
> -----------------------------------------------
>
>                 Key: WICKET-3338
>                 URL: https://issues.apache.org/jira/browse/WICKET-3338
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.5-M3
>            Reporter: Willis Blackburn
>
> This pattern occurs so frequently that Wicket should support it directly:
> Link myLink = new Link("myLink") { ... }
> myLink.add(new Label("my Label", "A Link"));
> add(myLink);
> becomes:
> LabelLink myLink = new LabelLink("myLink", "A Link");
> Obviously the second parameter could be a string or an iModel<?> that would 
> be converted to a string.
> I see that there have been some discussions about this before;  unfortunately 
> apparently the thread has been deleted.  But whatever arguments there are 
> against LabelLink are IMHO defeated by the fact that ExternalLink *does* have 
> a label model!  So why are labels okay for external links but not for 
> internal links?
> I actually think that ExternalLink should have its label removed;  there are 
> many cases in which external links do not have labels, and this would save 
> several bytes per label.  But there should be a LabelExternalLink as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to