Hi,
I'm trying to create a disableable AjaxSubmitLink. When a user clicks on the
link further clicks must not result in anything until the 'submission' is
complete. This call be achieved by adding "return false;" in a call decorator.
However I'm stuggling with the re-enabling. I need to strip the "return false"
and put the original destination back.
form.add(new AjaxSubmitLink("randomise", form) {
protected void onSubmit(AjaxRequestTarget target, Form form) {
somethingLong();
}
protected IAjaxCallDecorator getAjaxCallDecorator() {
return new AjaxCallDecorator() {
public CharSequence decorateScript(CharSequence script) {
return "return false;" + script;
}
public CharSequence decorateOnSuccessScript(CharSequence
script) {
// NEED TO RESET TO PREVIOUS STATE
}
public CharSequence decorateOnFailureScript(CharSequence
script) {
// NEED TO RESET TO PREVIOUS STATE
}
};
}
});
Any help would be most appreciated.
Thanks in advance
Anthony