Hi all,

In my Databinder-using application I have the requirement to
create/edit entities both within a standard request cycle, and via
AJAX inside a Modal Window.  In the interests of not duplicating code,
I would like to drive both these processes from the same Form object,
passing a boolean from the page to tell the Panel containing the Form
whether it's submitting normally or via AJAX.

I have run into the following problem:

The AJAX submission is via an AjaxSubmitButton.  This Component calls
the Form's onSubmit/onError methods before calling its own methods.
This means I cannot include any code specific to one method of
submission in the Form's onSubmit/onError methods.

Because of this, for a standard submission I use a Button with
defaultFormProcessing set to false and an overridden onSubmit method.
But the Button has no onError method, so I cannot provide any
standard-submission-specific error-handling code if the same object is
to handle an AJAX submission.

Does anyone have any suggestions on how to get around this?

At the moment I'm attempting to step around the issue by duplicating
all submission-processing code the page via an anonymous subclass of
the Panel/Form object, but I would appreciate a better solution if
anyone knows of one!

Cheers,
Charlie.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to