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
I would go a completely different route: add an AttributeModifier [1]. It
should look something like this:
Label label = new Label(label, Model.of(Text));
label.add(new AttributeModifier(class, Model.of(cssClassName)));
This is explained in more detail in the wicket-guide [2], Chapter 4.2.
In data martedì 27 agosto 2013 13:30:43, Collinson, Alasdair ha scritto:
I would go a completely different route: add an AttributeModifier [1]. It
should look something like this:
Label label = new Label(label, Model.of(Text));
label.add(new AttributeModifier(class,
It does. Here's a quick example, adapted from a quickstart:
package com.mycompany;
import org.apache.wicket.AttributeModifier;
import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.WebPage;
import
In data martedì 27 agosto 2013 14:46:03, Collinson, Alasdair ha scritto:
It does.
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.
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
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
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);