OAF Study Notes-in-depth View of Action and Navigation Buttons
Action/Navigation Buttons:
Execute the action on this page.
Navigate to another page.
Execute the action and navigate to another page.
Location of Action/Navigation Buttons:
Single Text field, Poplist.
Groups composed of multiple items
Table
Entire page
Action Buttons
Execute the Page Post action when you click the button
Create a button (Dynamic button)
Import oracle. apps. fnd. framework. webui. beans. form. OASubmitButtonBean;
Import oracle. apps. fnd. framework. webui. OAWebBeanConstants;
OASubmitButtonBean aa = (OASubmitButtonBean) pageContext. getWebBeanFactory (). createWebBean (pageContext, OAWebBeanConstants. BUTTON_SUBMIT_BEAN); // instantiate
Aa. setID ("Go"); // defines the ID
Aa. setUINodeName ("xxSubmitButton"); // define UINodename
Aa. setEvent ("Go"); // defines the event name
Aa. setText ("Go"); // define the Prompt
WebBean. addIndexedChild (aa); // displayed on the page
Note: This is a general routine for dynamically generating items. The setUINodeName can be omitted, and OAF will automatically allocate it. The last sentence is to specify the Region in which the button is generated. Here is the entire page, if you have specific Region, use the following method to generate it:
Assume that you need to generate a button in the Region of TableLayout:
Import oracle. apps. fnd. framework. webui. beans. layout. OATableLayoutBean;
OATableLayoutBean cont = (OATableLayoutBean) webBean. findIndexedChildRecursive ("RepeatRN"); // instantiate Region
OASubmitButtonBean aa = (OASubmitButtonBean) pageContext. getWebBeanFactory (). createWebBean (pageContext, OAWebBeanConstants. BUTTON_SUBMIT_BEAN); // instantiate the button
Aa. setID ("Go ");
Aa. setUINodeName ("xxSubmitButton ");
Aa. setEvent ("Go ");
Aa. setText ("abcd ");
Cont. addIndexedChild (aa); // note that a button is displayed on the page using the method of the previously instantiated webbean object.
Control visual property (dynamic attribute setting)
At runtime, only one attribute may need to be changed, that is, the button's Prompt. You can call setText to implement it (first instantiate the button)
Control Behavior. and Data (Behavior and Data Control)
Availability: The setDisabled (Boolean) Setting button is unavailable.
Verification: After the setUnvalidated (Boolean) button is clicked, onSubmit validation (Client) is not triggered)
After the setServerUnvalidated (Boolean) button is clicked, onSubmit validation (Server) is not triggered)
Handle Button Press Events (get Button event)
Two methods:
Use the Page Post action to obtain
Public void processFormRequest (OAPageContext pageContext, OAWebBean webBean)
{
... // Check to see if a submit button named "Go" has been pressed.
If (pageContext. getParameter ("Go ")! = Null)
{
...
Use FireAction to obtain
First, define the Event name of the FireAction button, and then obtain the Event in processFormRequest.
Public void processFormRequest (OAPageContext pageContext, OAWebBean webBean)
{
Super. processFormRequest (pageContext, webBean );
If (pageContext. getParameter (EVENT_PARAM). equals ("Go "))
{
PageContext. getApplicationModule (webBean). invokeMethod ("updatedata ");
}
}
Author: "Soy Milk"