Wicket LoadableDetachableModel exception handling issue
In my project, I am using LoadableDetachableModel as given below. public ReportPage(final Objectm, final PageReference pr) throws CustomException{try{final LoadableDetachableModelListMaintReport ldm = new LoadableDetachableModelListMaintReport() { @Override protected ListMaintReportload() { **// Some Database operations //** return x; } }; /* Several LoadableDetachableModels, PageableListViews, Panels, Fragments etc. */ } catch ( Exception ex){// create Custom Exception } finally { // Clean up of stuff } My problem is that I am using AbstractColumn to display the objects in the column and the overriden populateItem() method calls the load() internally. Since both the methods cannot throw Exceptions, I cannot really catch exceptions and display appropriate messages. Any help on this is really appreciated. -- Thanks Regards JK
Re: Wicket LoadableDetachableModel exception handling issue
How about wrapping it to a RuntimeException, or preferably, your own subclass of it? Ondra On 02/20/2013 04:51 PM, Jayakrishnan R wrote: In my project, I am using LoadableDetachableModel as given below. public ReportPage(final Objectm, final PageReference pr) throws CustomException{try{final LoadableDetachableModelListMaintReport ldm = new LoadableDetachableModelListMaintReport() { @Override protected ListMaintReportload() { **// Some Database operations //** return x; } }; /* Several LoadableDetachableModels, PageableListViews, Panels, Fragments etc. */ } catch ( Exception ex){// create Custom Exception } finally { // Clean up of stuff } My problem is that I am using AbstractColumn to display the objects in the column and the overriden populateItem() method calls the load() internally. Since both the methods cannot throw Exceptions, I cannot really catch exceptions and display appropriate messages. Any help on this is really appreciated. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket LoadableDetachableModel exception handling issue
i have already done that as a back up plan. Do you think wicket is a bit wierd in handling exceptions. On 20 Feb 2013 16:22, Ondrej Zizka ozi...@redhat.com wrote: How about wrapping it to a RuntimeException, or preferably, your own subclass of it? Ondra On 02/20/2013 04:51 PM, Jayakrishnan R wrote: In my project, I am using LoadableDetachableModel as given below. public ReportPage(final Objectm, final PageReference pr) throws CustomException{try{final LoadableDetachableModelList**MaintReport ldm = new LoadableDetachableModelList**MaintReport() { @Override protected ListMaintReportload() { **// Some Database operations //** return x; } }; /* Several LoadableDetachableModels, PageableListViews, Panels, Fragments etc. */ } catch ( Exception ex){// create Custom Exception } finally { // Clean up of stuff } My problem is that I am using AbstractColumn to display the objects in the column and the overriden populateItem() method calls the load() internally. Since both the methods cannot throw Exceptions, I cannot really catch exceptions and display appropriate messages. Any help on this is really appreciated.
Re: Wicket LoadableDetachableModel exception handling issue
Actually I think Wicket offers, inherently, one of the best ways to handle exceptions - I can catch it wherever I want, rewrap, redirect, ignore, alter the model... I haven't seen such freedom and versatility in any other web framework. YMMV. Ondra On 02/20/2013 05:39 PM, Jayakrishnan R wrote: i have already done that as a back up plan. Do you think wicket is a bit wierd in handling exceptions. On 20 Feb 2013 16:22, Ondrej Zizka ozi...@redhat.com mailto:ozi...@redhat.com wrote: How about wrapping it to a RuntimeException, or preferably, your own subclass of it? Ondra On 02/20/2013 04:51 PM, Jayakrishnan R wrote: In my project, I am using LoadableDetachableModel as given below. public ReportPage(final Objectm, final PageReference pr) throws CustomException{try{final LoadableDetachableModelListMaintReport ldm = new LoadableDetachableModelListMaintReport() { @Override protected ListMaintReportload() { **// Some Database operations //** return x; } }; /* Several LoadableDetachableModels, PageableListViews, Panels, Fragments etc. */ } catch ( Exception ex){// create Custom Exception } finally { // Clean up of stuff } My problem is that I am using AbstractColumn to display the objects in the column and the overriden populateItem() method calls the load() internally. Since both the methods cannot throw Exceptions, I cannot really catch exceptions and display appropriate messages. Any help on this is really appreciated.