First page Back Continue Last page Graphics

Creating Action Methods


Notes:

Creating Action Methods

You can create an action in JDeveloper by:

Invoking the action-binding editor by either double-clicking the component in the editor or by right-clicking it in the Structure window and selecting Create Method Binding for Action.

In the action-binding editor, you can accept the proposed method name or change it to a name of your choice. You can select to create a new bean and method if desired.

You then add whatever code you need to the action method. Remember that action methods can be used for controlling the UI, modifying values, or navigation; however, action methods return a String outcome.

For example, the myBean.selectWhere method depicted in the slide could have code similar to the following:

public String selectWhere() {

if <some condition> {

return (“cart”); /* navigate to shopping cart */

}

else {

return(“prod”); /* navigate to Product page */

}}