Found the solution!
Not using SimpleFormComponentLabel as it is replacing it's content, but
using FormComponentLabel (to get for=... attribute) in combination with the
wicket:message solution:

final FormComponentLabel termsAndConditionsCheckLabel = new
FormComponentLabel("termsAndConditionsCheckLabel", acceptedTerms);
        form.add(termsAndConditionsCheckLabel);

final Link terms = new Link("terms") {
            private static final long serialVersionUID = 1L;

            @Override
            public void onClick() {
                setResponsePage(TermsOfUsePage.class);
            }
        };
        termsAndConditionsCheckLabel.add(terms);

final Label termsOfUse = new Label("terms_of_use", new
ResourceModel("terms_of_use"));
        termsOfUse.setRenderBodyOnly(true);
        terms.add(termsOfUse);

Markup:

<label wicket:id="termsAndConditionsCheckLabel">
  <wicket:message key="termsAndConditionsCheckLabel">Ich bin mindestens 18
Jahre alt und mit den &lt;a href="#" wicket:id="terms"&gt;&lt;span
wicket:id="terms_of_use"&gt;AGB's&lt;/span&gt;&lt;/a&gt; und den
Datenschutzbestimmungen einverstanden.</wicket:message></label>

Messages:
<entry key="termsAndConditionsCheckLabel">I am 18 years old and agree with
the ${terms} and conditions.</entry>
<entry key="terms_of_use">Terms of Use</entry>

I will add this solution to the Wiki! ;-)

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/SimpleFormComponentLabel-with-page-link-in-label-tp4562036p4562365.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to