Re: AW: AW: AW: Styling label tags
In data martedì 27 agosto 2013 15:58:52, francois meillet ha scritto: try that 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 Maybe that would work to some extent, but it would have at least the following issues: 1. it wouldn't pass HTML validation (label for=... must refer to an existing input id=...) 2. Given 1 above, it wouldn't be possible to reuse the panel in a RepeatingView and obtain valid HTML anymore, because in RepeatingViews Wicket needs wicket:for attribute in order to generate valid for=... and id=... pairs. 3. it wouldn't pass to the browser the information about what label matches what input field (the fact they invented the label tag must mean something, right?) - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: AW: AW: Styling label tags
I don't agree: I can't see any label tags in your markup. I don't need to remove my label tags (and I don't want to), I need to dynamically add a class=cssClassName to them instead. Sorry, my mistake - I didn't modify the markup enough. Luckily, whether it's a wicket:container or a label doesn't make any difference here. So if you change the markup in my example to Do you see the following? -gt;label wicket:id=version1.5-SNAPSHOT/labellt;- It still works with the same Java-Code. Alasdair - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AW: AW: AW: Styling label tags
In data martedì 27 agosto 2013 15:12:01, Collinson, Alasdair ha scritto: So if you change the markup in my example to Do you see the following? -gt;label wicket:id=version1.5-SNAPSHOT/labellt;- It still works with the same Java-Code. Unfortunately not, because my label tags are part of a form, they have a wicket:for attribute referring to the corresponding input tags, and they can't have a wicket:id also. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AW: AW: AW: Styling label tags
try that private class FormExemple extends FormExempleModel { public FormExemple(String myForm, CompoundPropertyModelExempleModel model) { super(myForm, model); TextFieldString tf_name = new TextFieldString(name); add(tf_name); FormComponentLabel formComponentLabel = new FormComponentLabel(label_tag, tf_name); formComponentLabel.add(new AttributeModifier(class, Model.of(YourCssClassName))); Label label = new Label(label_tag_Text, test_label); formComponentLabel.add(label); add(formComponentLabel); add(tf_name); } } 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 Tue, Aug 27, 2013 at 3:23 PM, Lucio Crusca lu...@sulweb.org wrote: In data martedì 27 agosto 2013 15:12:01, Collinson, Alasdair ha scritto: So if you change the markup in my example to Do you see the following? -gt;label wicket:id=version1.5-SNAPSHOT/labellt;- It still works with the same Java-Code. Unfortunately not, because my label tags are part of a form, they have a wicket:for attribute referring to the corresponding input tags, and they can't have a wicket:id also. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org