I have the Ajax stuff working in my form. I want to use the same form
(placed on a WebPage) to handle when JS is off, I override the onSubmit()
for when JS is off. But this must be wrong because the
AjaxFormSubmitBehavior no longer gets call, only the onSubmit is called.
Form f = new Form("f", new CompoundPropertyModel(this)) {
@Override
public void onSubmit() {
handleRatingChanged(null); // good when JS if off,
but how to
make the Ajax stuff work
// when JS is
back on?
}
};
f.setOutputMarkupId(true);
f.add(new TextField("rating", Integer.class));
add(f);
//
// Ajax stuff, after the onSubmit is overridden in the form, this is
no longer work!
//
f.add(new AjaxFormSubmitBehavior("onsubmit") {
@Override
protected void onSubmit(AjaxRequestTarget target) {
handleRatingChanged(target);
}
@Override
protected void onError(AjaxRequestTarget target) {
}
@Override
protected IAjaxCallDecorator getAjaxCallDecorator() {
return new AjaxCallDecorator() {
public CharSequence decorateScript(CharSequence
script) {
return script + " return false;";
}
};
}
});
--
View this message in context:
http://www.nabble.com/How-to-make-a-Form-work-both-Ajax-and-no-Ajax--tp15628207p15628207.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]