Which is exactly the implementation of external link IMO. Martijn
On Fri, Mar 27, 2009 at 5:48 PM, Jeremy Thomerson <[email protected]> wrote: > public class EmailLink extends WebMarkupContainer > { > private static final long serialVersionUID = 1L; > > public EmailLink(String id, IModel<String> emailAddress) > { > super(id, emailAddress); > } > > �...@override > protected void onComponentTag(ComponentTag tag) > { > super.onComponentTag(tag); > tag.put("href", "mailto:" + getDefaultModelObjectAsString()); > } > > �...@override > protected void onComponentTagBody(MarkupStream markupStream, > ComponentTag openTag) > { > replaceComponentTagBody(markupStream, openTag, > getDefaultModelObjectAsString()); > } > } > > > -- > Jeremy Thomerson > http://www.wickettraining.com > > > > On Fri, Mar 27, 2009 at 9:21 AM, <[email protected]> wrote: > >> I'm still not seeing how to do this using the ExternalLink component. >> I'm reading the email addresses from a database and using a ListView to >> iterate through them to display on the screen. I added the following to my >> Java file: >> >> item.add(new ExternalLink("email", user.getEmail())); >> >> And the following to my markup: >> >> <a href="#" wicket:id="email"></a> >> >> Obviously, this isn't complete, but I'm not sure what I need to do to get >> it to turn the email address into something like: >> >> <a class="email" href="mailto:[email protected]">[email protected]</a> >> >> -------------- Original message from Martijn Dashorst < >> [email protected]>: -------------- >> >> >> > The easiest that comes to mind: >> > >> > new ExternalLink("link", "mailto:[email protected]") >> > >> > Martijn >> >> > -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.3.5 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.
