AttributeModifier that appends the given value, rather than replace it. This is especially useful for adding CSS classes to markup elements, or adding JavaScript snippets to existing element handlers.
<a href="#" wicket:id="foo" class="link" onmouseover="doSomething()">
can be modified with these AttributeAppenders:
link.add(new AttributeAppender("class", Model.of("hot"))); link.add(new AttributeAppender("onmouseover", Model.of("foo();return false;")).setSeparator(";"));
this will result in the following markup:
<a href="#" wicket:id="foo" class="link hot" onmouseover="doSomething();foo();return false;">
@see AttributeModifier#append(String,IModel)
@see AttributeModifier#append(String,Serializable)
@see AttributeModifier#prepend(String,IModel)
@see AttributeModifier#prepend(String,Serializable)
@author Martijn Dashorst