you may want to take a look at the class FormComponentLabel
it should do the trick

On 5/5/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

Ok, but how does one do labels properly like this (i.e. with a for
attribute).

A reminder of what this thread was about ...

I'm reusing a custom PostalAddressFieldsetPanel component twice in a form
so
eventual markup sent to browser should look something like this:

<fieldset>
  <legend>Delivery address</legend>
  <label for="deliveryAddress_street">Street</label>
  <input type="text" id="deliveryAddress_street" ... />
  ...
</fieldset>

<fieldset>
  <legend>Invoice address</legend>
  <label for="invoiceAddress_street">Street</label>
  <input type="text" id="invoiceAddress_street" ... />
  ...
</fieldset>

If I delegate to the framework to create the unique 'id' attributes for
the input tags as explained below,
how do I make sure the 'for' attributes of their labels have the same
values.

Cheers,
Derek


-----Original Message-----
From: [EMAIL PROTECTED] on behalf of Martijn
Dashorst
Sent: Mon 4/30/2007 4:26 PM
To: wicket-user@lists.sourceforge.net
Subject: Re: [Wicket-user] Nested Forms and onSubmit()?

On 4/30/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Ok, but name != id in xhtml and the value of xhtml id attributes on the
page must be unique
> or it isn't valid.
>
> Do I need to ensure that any custom components do not include an xhtml
id attribute?

Yes you do, but you can let Wicket generate the id's for you with
setOutputMarkupId(true). Wicket will take care of making them unique
in your page.

Martijn

--
Learn Wicket at ApacheCon Europe: http://apachecon.com
Join the wicket community at irc.freenode.net: ##wicket
Wicket 1.2.6 contains a very important fix. Download Wicket now!
http://wicketframework.org

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


***** Email confidentiality notice *****
This message is private and confidential. If you have received this
message in error, please notify us and remove it from your system.

The London School of Economics and Political Science (the School) is a
company limited by guarantee, registered in England and Wales, under
registered number 00070527, and having its registered office at 10th Floor,
Tower One, Houghton Street, London WC2A 2AE.

The inclusion of this information does not of itself make this email a
business document of the School and, to the maximum extent permitted by law,
the School accepts no liability for the content and opinions in any
non-business emails.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to