I can understand why onException might only be used for internal exceptions
in processing, but shouldn't the exception at least escalate back up to
RequestCycle.onRuntimeException and be handled there?

Otherwise, are we expected to always catch any possible Throwable in our
onSubmit if we want to be able to handle it server side? Seems a bit wonky
to not be able to rely on standard exception handling for this sort of
thing....


igor.vaynberg wrote:
> 
> 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
> 
> 

-- 
View this message in context: 
http://www.nabble.com/AbstractBehavior-or-AjaxFormSubmitBehavior-exception-handling-tf3402992.html#a9478323
Sent from the Wicket - User mailing list archive at Nabble.com.


-------------------------------------------------------------------------
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