Tuesday, August 16, 2011

Execute a default command button on clicking 'Enter' anywhere in the af:form in Oracle ADF?

This can be achieved by configuring the defaultCommand property of the af:form tag in the jsff page fragment or jspx page document in Oracle ADF.

We have to configure defaultCommand with the id attribute of the command button inside the form whose action should be invoked by default when the enter key is pressed with focus inside the form. If defaultCommand is not specified, no action is invoked when the enter key is pressed with focus inside the form.

For example:

<af:form id="f1" defaultCommand="pt1:cb4">