Based on my previous blog post - Handling Exceptions in Oracle UI Shell and ADF Dynamic Regions, blog reader was asking - if it is possible to simplify provided sample application and show ViewController exception in lightweight Popup component, instead of closing all UI Shell tabs and rendering dynamic region. I did some research and answer is yes, possible. Today I will describe updated sample application, where exceptions are rendered in popup component, and UI Shell tabs are not closed as in previous implementation.
Download sample application - ADFIntegrationUIShell3.zip. This sample implements lightweight popup to render exception messages handled by ADF Task Flow exception handler activity.
If you will take a look into previous sample, from blog post above, you will notice key difference in Launcher bean getDynamicTaskFlowId() method. You will see that this method is simplified now - even in case of error, the same dynamic region (welcome region) will be rendered. In previous sample, in case of error, another dynamic region was rendered - error region. Its changed now, to render basic FacesMessage, instead of heavy dynamic region, in case off error:
Welcome region is declared as dynamic region, same as before:
This allows to re-execute getDynamicTaskFlowId() method, when error happens - because exception handler activity is declared on the same page where UI Shell is implemented. UI Shell page is pretty straightforward, it contains only reference to welcome dynamic region:
Thats it, we are ready to test now, but before doing test - let's check one small hint. In latest JDev 11g PS2, we got updated Fusion skin - fusion-188.8.131.52.0. This new skin version contains fixes for Tab components, I have noticed UI Shell tabs are rendered faster now. So, I have updated sample application to work with latest Fusion skin:
You can see, Tab components are rendered much better, and I should say that tabs are opening faster:
As per previous sample, Departments region contains broken reference to Commit operation, Save button generates exception. Let's test it and press Save button, now UI Shell tabs are not closed, but popup is rendered with information about exception:
User can close error popup and continue to work with the system, exception was cleared from ControllerContext programmatically: