Anda di halaman 1dari 3

Add Submit Button Using OA

Framework Extension
The purpose of this article is twofold
1. To understand one of the limitations of OA Framework personalization, in case you wish to add new “Submit
Button” to a page.
2. To explain, what exactly happens when a page in OA Framework gets Submitted

When working on OA Framework extensions, you may have a requirement to add a new Submit Button to the page.
This type of extension necessitates the need to extend the controller.

Why can’t I add a Submit Button using personalization?


Simply because Oracle’s OA Framework doesn’t allow you to do so via personalization.

Not even in R12?


Indeed, not even in R12 [checked upto Rollup3]

But using personalization, I can see the option to add a button using personalization on my instance!
Using personalization, you can add normal buttons, but not Submit Buttons.

What is the difference between a normal button and a submit button?


A Submit Button posts the page to the application server. In other words, the data entered by the user into the
fields/records is sent to the Application Server, where data can be validated as per business logic and DML’s can be
performed [via say jdbc].
In layman’s language, when you click on Submit Button in OA Framework, following sequence of events happen

Steps executed in OA Submit Button Normal Button


Framework when
Button is clicked

Java controller class Yes No


against the region is
invoked

ProcesFormData in Yes No
Controller is called. This
method fetches/sucks
the data from fields in the
screens and populates
the View Object Record
Attributes in cache.

If View Object is based Yes No


on Entity Object, then
ViewObject Row cache is
not updated. But instead
Entity Object Row cache
is updated

If Screen is based on a Yes No


VO, and the VO is based
on EO[s], then cache of
EO is validated by
execution of a method
called validateEntity()

Finally, if no errors occur Yes No


in previous steps, i.e. if
no Unhandled
exceptions were
thrown, then
processFormRequest is
called, where button click
can be trapped and you
can decide between :-
a. next navigation
b. commit data
c. rollback data
d. change variables
e. miscellaneous as per
requirements

Note the sentence above that is underlined.

Lets say your requirement is


User enters data into fields in OA Framework Page
When button is clicked, the data must be validated
If data validation succeeds, then send navigation to next page.
If data validation fails, then do not navigate to next page [instead display error on same page]

Now, reverting back to underlined statement, if processFormData invokes validations, and if validations were to throw
an unhandled exception, then processForRequest will not be called. Hence execution will never reach
processFormRequest in case of validation failure. Given that we usually perform navigational actions within
processFormRequest, navigation to the next page will hence be stopped.

If so, then what is the need for a plain Button?


A plain button has no interaction with the Application Server. It is simply used to invoke java script, for example
opening another website etc.

How do we add a submit button programmatically?


We will cover this in the article following this one.

Anda mungkin juga menyukai