On Wed, Jun 8, 2011 at 1:02 PM, James Carman
<[email protected]> wrote:
> What about the separator?
I'm thinking of ditching the separator as a constructor parameter, and
defaulting to ' ' (space). Is there anyone who uses any other value
for the separator? The attribute modifier will have a setter for the
separator, so that you can do AttrbuteModifier.append("onclick",
"return false;").setSeparator(";");
As for the fluent api... we can add that as a bonus. I'd like to keep
the shorthand for AttributeModifier.append/prepend/overwrite
Might I suggest the following fluent api:
AttributeModifier.for("class").overwrites().value("error");
AttributeModifier.for("class").appends().value(Model.of("error"));
AttributeModifier.for("onclick").prepends().value("if(!confirm('Sure?'))
return false;');
Or perhaps:
AttributeModifier.for("class").puts("error");
AttributeModifier.for("class").appends(Model.of("error"));
AttributeModifier.for("onclick").prepends("if(!confirm('Sure?'))
return false;');
Martijn
--
Become a Wicket expert, learn from the best: http://wicketinaction.com