Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

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);