THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block |
---|
... protected class MyBehavior extends AbstractDefaultAjaxBehavior { @Override protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); String js = "{wicketAjaxGet('" + getCallbackUrl() + "&'+this.name+'='+wicketEncode(this.value)); return false;}"; tag.put("onblur", js); } @Override protected void respond(AjaxRequestTarget target) { FormComponent c = (FormComponent) getEditorComponentgetMyComponent(); c.processInput(); if (c.hasErrorMessage()) { Serializable msg = c.getFeedbackMessage().getMessage(); // do something with the message } } } ... |
Adding ajax to events:
Code Block |
---|
body.add(new AjaxEventBehavior("onload"){ protected void onEvent(AjaxRequestTarget target){ // do something } }); |