Thursday, August 23, 2012

How to define default action/button for ADF

How to define default action/button for ADF page

There are many use cases where user wants the functionality to submit page at anytime not just click on the specific button.

This is very common requirement where user filling the data and they want to form to be submit on "Enter Key Press" without moving the cursor to button and click on it.

Oracle ADF faces provide us the facility to define the default action for form. This functionality can be achieved using the .
Find below subform implementation:

In this above code defaultCommand="cb1"  represent the default action for the form.

af:subform  can be used multiple time to provide default action/command for different areas in single page.











5 comments:

  1. Hi,
    when subform exists in table. Default Command does not work unfortunatelly. Is there any solution for that?
    thx

    ReplyDelete
  2. try af:form --------- and not af:subform

    Edgar

    ReplyDelete
  3. Hi, I have the same problem, when the focus is in table (e.g. a row selection) defaultCommand won't work, did you find a workaround?

    ReplyDelete
  4. On submit using enter press, the value added in inputText will not be submitted.
    I am facing this issue in my application.
    Input text is having autoSubmit to true as well.
    Any suggestion?

    ReplyDelete

Thanks for your valuable comment. You comment will go live soon.