I add/modify the class attribute through AjaxFormComponentUpdatingBehavior. Is it too late by then?
i ask this since it doesn't show up in the ajax response.
textField.add(new AjaxFormComponentUpdatingBehavior("onblur") {
@Override
protected void onUpdate(AjaxRequestTarget target) {
if (!getFormComponent().isValid()) {
getFormComponent().getMarkupAttributes().put("class",
"invalid");
}
target.addComponent(getFormComponent());
}
});
But having it onComponentTag works ..
textField.add(new AjaxFormComponentUpdatingBehavior("onblur") {
@Override
protected void onUpdate(AjaxRequestTarget target) {
target.addComponent(getFormComponent());
}
protected void onComponentTag(final ComponentTag tag){
super.onComponentTag(tag);
if (!getFormComponent().isValid()) {
tag.put("class","invalid");
} else {
tag.put("class","valid");
}
}
});
- Siddharth
- [Wicket-user] AjaxFormComponentUpdatingBehavior and tag ... Siddharth Agarwal
- Re: [Wicket-user] AjaxFormComponentUpdatingBehavior... Igor Vaynberg
- Re: [Wicket-user] AjaxFormComponentUpdatingBeha... karthik Guru
- Re: [Wicket-user] AjaxFormComponentUpdating... Igor Vaynberg
- Re: [Wicket-user] AjaxFormComponentUpdating... karthik Guru
