There are three different approaches to adding or updating a Components HTML attributes.
...
Code Block |
---|
...
// this can be any Component
new TextField("my-text-field", myModel){
@Override
protected void onComponentTag(final ComponentTag tag){
super.onComponentTag(tag);
tag.put("onmouseover", "foo();return false;");
}
};
...
|
...
Code Block |
---|
...
new TextField("my-text-field", myModel).add(new AbstractBehavior(){
@Override
public void onComponentTag(Component component, ComponentTag tag) {
tag.put("onmouseover", "foo();return false;");
}
});
...
|
...