Re: Styling label tags

2013-09-04 Thread Lucio Crusca
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.





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



Re: Styling label tags

2013-09-04 Thread Martin Grigorov
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




Re: Styling label tags

2013-09-04 Thread francois meillet
Hi Lucio,

The for=anything was referring to the id=anything of the input tag,
which is valid. See http://www.w3schools.com/tags/tag_label.asp.

form wicket:id=form
label wicket:id=label_tag for=anything
span  wicket:id=label_tag_Text /span
/label
input wicket:id=name type=text size=40 id=anything 
/form

François


On Wed, Sep 4, 2013 at 9: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.





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




Re: Styling label tags

2013-09-02 Thread Martin Grigorov
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




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




Re: Styling label tags

2013-09-02 Thread tan_packt
Hi..There is a new Apache Wicket book. Instant Apache Wicket 6 by João
Sávio Ceregatti Longo and Felipe Fedel Pinto. In case you'd be interested in
getting an ebook copy and writing a review on your
blog/website/amazon.com/goodreads.com. Please contact me at:
tan...@packtpub.com 
Here is the link of the book for your convenience: http://bit.ly/15w4LEI 



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Styling-label-tags-tp4661070p4661167.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



Re: Styling label tags

2013-08-31 Thread Lucio Crusca
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.


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



Re: Styling label tags

2013-08-30 Thread Lucio Crusca
In data mercoledì 28 agosto 2013 08:59:56, Lucio Crusca ha scritto:
 Maybe that would work to some extent, but it would have at least the
 following issues: [...]

No more replies. Should I deduce there's no known solution?

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



Re: Styling label tags

2013-08-30 Thread Martin Grigorov
Hi Lucio,

The suggested solution should work.
Did you try it ?
What kind of issues you faced ?

Give us more details and some code and we will tell you where is the
problem.


On Fri, Aug 30, 2013 at 11:36 AM, Lucio Crusca lu...@sulweb.org wrote:

 In data mercoledì 28 agosto 2013 08:59:56, Lucio Crusca ha scritto:
  Maybe that would work to some extent, but it would have at least the
  following issues: [...]

 No more replies. Should I deduce there's no known solution?

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




Re: Styling label tags

2013-08-27 Thread Lucio Crusca
In data lunedì 26 agosto 2013 11:28:27, francois meillet ha scritto:
 have a look to
 
 http://ci.apache.org/projects/wicket/apidocs/6.0.x/org/apache/wicket/markup
 /html/form/FormComponentLabel.html and
 http://ci.apache.org/projects/wicket/apidocs/6.0.x/org/apache/wicket/markup
 /html/form/SimpleFormComponentLabel.html
 
 François

I've had a look, but I'm afraid I need a little example. I have the following 
markup:

wicket:panel
  label wicket:for=input
span wicket:id=inputSpan[label text]/span
input wicket:id=input type=checkbox /
  /label
/wicket:panel

and the following (simplified) java code:

public class LabeledCheckbox extends Panel
{
  public LabeledCheckbox(String id, String uiText, IModelBoolean model)
  {
super(id);
Label spanLabel = new Label(inputSpan, uiText);
add(spanLabel.setRenderBodyOnly(false));
CheckBox cb = new checkBox(input, model);
cb.setLabel(Model.of(uiText));
add(cb);
setRenderBodyOnly(true);
  }
}

If I add a FormComponentLabel then I need to specify its wicket:id attribute, 
but I can't use both wicket:id and wicket:for attributes together.

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



Re: Styling label tags

2013-08-26 Thread francois meillet
have a look to

http://ci.apache.org/projects/wicket/apidocs/6.0.x/org/apache/wicket/markup/html/form/FormComponentLabel.html
and
http://ci.apache.org/projects/wicket/apidocs/6.0.x/org/apache/wicket/markup/html/form/SimpleFormComponentLabel.html

François


On Sun, Aug 25, 2013 at 6:30 PM, Lucio Crusca lu...@sulweb.org wrote:

 I need to dynamically set class=cssClassName to some label tags. Just
 now
 I set the label text with:

   myFormComponent.setLabel(...)

 but how do I change its css class?


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