The attribute whose value is to be modified must be given on construction of the instance of this class along with the model containing the value to replace with.
If an attribute is not in the markup, this modifier will add an attribute.
Instances of this class should be added to components via the {@link Component#add(Behavior)}method after the component has been constructed.
It is possible to create new subclasses of {@code AttributeModifier} by overriding the{@link #newValue(String,String)} method. For example, you could create an{@code AttributeModifier} subclass which appends the replacement value like this:
new AttributeModifier("myAttribute", model) { protected String newValue(final String currentValue, final String replacementValue) { return currentValue + replacementValue; } };@author Chris Turner @author Eelco Hillenius @author Jonathan Locke @author Martijn Dashorst @author Ralf Ebert
|
|
|
|
|
|