ok

onexception is for exceptions that occur during form processing. in
onsubmit() you are responsible to process your own exceptions since that is
your own handler code

-igor


On 3/14/07, Apaar Trivedi <[EMAIL PROTECTED]> wrote:

 Something like the following code:



        Button searchButton = *new* Button("searchButton", 
*new*StringResourceModel(
"searchButton", *this*, *null*));

        searchButton.add(*new* MyAjaxFormSubmitBehaviorWithIndicator(form,
"onclick") {



            *protected* *void* onError(AjaxRequestTarget arg0) {

                *super*.onError(arg0);

            }



            *public* *void* onException(Component target, RuntimeException
e) {  ß Does not get called

                *super*.onException(target, e);

            }



            *protected* *void* onSubmit(AjaxRequestTarget target)
{

                Collection ldapUsers = getUsersOrGroupsFromLdap() ß causes
a null pointer exception

                target.addComponent(*this*);

            }

}



So in the following code, AbstractBehavior.onException does not get
called, and it is also not being handled by RequestCycle.onRuntimException,
since I have overridden that to catch run time exceptions already, I know it
is not being called.  This is making it rather difficult to implement ajax
error handling for this situation.



Alternatively, I have a similar piece of code where I explicitly do a
'throw new MyRuntimeException()', and this DOES get handled by
RequestCycle.onRuntimeException.



Any ideas?



Thanks


 ------------------------------

*From:* [EMAIL PROTECTED] [mailto:
[EMAIL PROTECTED] *On Behalf Of *Igor Vaynberg
*Sent:* Wednesday, March 14, 2007 11:05 AM
*To:* [email protected]
*Subject:* Re: [Wicket-user] AbstractBehavior or
AjaxFormSubmitBehaviorexception handling



onexception where? onerror is called when a form validation error occurs.

-igor

 On 3/14/07, *Apaar Trivedi* < [EMAIL PROTECTED]> wrote:

Hey guys,



When I have an exception (in this case a NullPointerException) occur
during the onSubmit of an AjaxFormSubmitBehavior, neither onException or
onError is being called.  Why is that?  I thought these methods existed
specifically to catch these types of problems?



Thanks

Par




-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user



-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user


-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to