Hi Lucio, On Wed, Sep 4, 2013 at 10:06 AM, Lucio Crusca <lu...@sulweb.org> wrote:
> On Monday 02 September 2013 10:12:25 Martin Grigorov wrote: > > On Sat, Aug 31, 2013 at 10:18 AM, Lucio Crusca <lu...@sulweb.org> wrote: > > > In data venerdì 30 agosto 2013 10:48:35, Martin Grigorov ha scritto: > > > > Hi Lucio, > > > > The suggested solution should work. > > > Which one? I think I've tried all of them and reported issues here, > but > > > maybe > > > I missed one. > > FormComponentLabel + AttributeModifier > > I didn't understand how I'm supposed to use the FormComponentLabel class, > since wicket:id and wicket:for cannot be put together in the same <label> > tag and I need a reusable and repeatable panel with a styled <label> tag > inside. I asked for an example and Francois Meillet provided one, but his > example didn't use the wiket:for attribute, which I need, and using a > dummy for="anything" is invalid HTML. > Wicket is open source, i.e. it is very easy to see what a given class does. You can check https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/markup/html/form/FormComponentLabel.java?source=cc#L76 and see that FormComponentLabel sets the 'for' attribute for you. So there is no need of wicket:for in this case. Also there is https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/markup/html/form/SimpleFormComponentLabel.java?source=cc that uses form component's label to set the text if you want. Wicket-Examples project provides examples how to use these components. See https://github.com/apache/wicket/blob/master/wicket-examples/src/main/java/org/apache/wicket/examples/forminput/FormInput.java?source=cc#L126 What's left for you is to use AttributeModifier or its specialization AttributeAppender to set the class for any label. > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >