THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
When you set isReadOnly to true now, the controls will be read-only, and will have the format you defined in your stylesheet
or another avoiding deprecated apis...
From version 1.5 Wicket has depricated the constructor
Code Block |
---|
AttributeModifier(java.lang.String attribute, boolean addAttributeIfNotPresent, IModel<?> replaceModel)
|
To avoid using attribute modifiers you can sub class the TextField and override a couple of fields.
An example in Scala
Code Block |
---|
val commentTF = new TextField("commentTF", commentModel) {
override def isEnabled() = !isReadOnly();
override def onDisabled(tag: ComponentTag) = tag.put("readonly", "readonly");
}
form.add(commentTF);
|