Sunday 10 February 2013

Handling of DC Exception/Binding Container Exception/JBO Exceptions

Exception Handling is very must for all the application, It ensures application is running in smooth. It is in our application, then allow the user to work without any interruptions. This exception handler is going to handle all DC Binding Container Exceptions or all ADF BC Exceptions. Follow the below steps,

  • Create class extends with DCErrorHandlerImpl and default constructor must contains this(true) for making this is a current one in the binding context.


  • Need to override the 'reportException' method and to handle our own logic for all the ADF BC Exceptions.


  • Configure the ErrorHandlerClass as our Exception Handler under the Application of databindings.cpx file.



For more details check with sample.

You can download the sample workspace from here.
[Runs with Oracle JDeveloper 11g R2 Update3 + HR Schema]

How to run this sample?
Run using the Run.jsf then press the button 'Print Employee Name' it throws actual exception of  'oracle.jbo.NoDefException: JBO-25058: Definition First_Na of type Attribute is not found in EmployeesVO' but it is handled and throw the custom exception message of 'Exception Occured, Please Contact Project Admin'. Also press 'Perform Divide Operation' and see the behaviour.

Friday 8 February 2013

Implementation of Instruction Help for Input Fields

Instruction Help is nothing but showing detail description about particular field. It shows as a speech bubble dialog against the UI field when the focus is inside. It is helpful to the end user for filling the Input fields. Follow the below steps for implementations,

  • Create an Application and View Controller project.
  • Open the ADF META-INF folder under the Application Resources and create a adf-settings.xml.
  • After creates a adf-settings need to include the help-provider-class and property. The help provider is oracle.adf.view.rich.help.ResourceBundleHelpProvider and the property is 'baseName'. It is in-build property of ResourceBundleHelpProvider and value is Resource Bundle name along with package.

  • The Key of the resource bundle entry should be suffix with '_INSTRUCTIONS'.

  • Editable UI Component of page or fragment should have the property of 'helpTopicId' and value is key of the resource bundle elements. Help Topic Id value should not includes '_INSTRUCTIONS'.


In addition, if you want to access the Instruction Help through EL expression then use #{adfFacesContext.helpProvider[Help Topic Id].instructions}.



For more details check with sample.

[Runs with Oracle JDeveloper 11g R2 Update3]

How to run this sample?
Run using the Help.jsf and HelpEL.jsf to check the Implementation of Instruction Help and how EL is used to access the Instruction Help.