final CheckBox cb=new CheckBox("cb");
cb.setOutputMarkupId(true);
WebMarkupContainer label=new WebMarkupContainer("label") {
oncomponenttag(tag) { tag.put("for", cb.getMarkupId()); }
label.add(new PageLink("terms", TermsPage.class));
label.add(new PageLink("policy", PolicyPage.class));
<input type="checkbox" wicket:id="cb"/><label wicket:id="label">agree to the
<a wicket:id="terms">terms of use</a> and <a wicket:id="policy>submission
policy</a></label>
-igor
On 8/10/07, Justin Morgan (Logic Sector) <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I asked this question before but didn't really understand the
> response. I need to create a CheckBox at the bottom of a form
> (ordinarily this is easy enough). The tricky part is that the check
> box's label will contain two hyperlinks that correspond to the
> underlined text in the example below:
>
> [x] I agree to the _Terms_of_Use_ and the
> _Submission_Policy_
>
> In the markup I could place the CheckBox labeled with "I agree to
> the", then place a terms of use Link, then a Label ("and the"), then
> another submission policy Link. That would solve my problem except
> the CheckBox is *required*. The requiredness error message would say
> something like:
> field 'I agree to the' is required
> and obviously that's not ideal for users.
>
> Since Wicket is all about OOP, should I create a subclass of
> CheckBox? What's the best approach? If there are any examples
> similar to this, I'd greatly appreciate hearing about it.
>
> Thanks for any help,
>
> Justin
>
> On Jun 12, 2007, at 11:56 PM, Timo Rantalaiho wrote:
>
> > On Tue, 12 Jun 2007, Justin Morgan (Logic Sector) wrote:
> >> My question is: How to I create a label that displays an error
> >> message correctly, yet also contains hyperlinks within the label?
> >
> > Make it a WebMarkupContainer that has the logic and
> > necessary child components.
> >
> > - Timo
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>