OAF学习笔记-深入View之Action and Navigation Buttons(深入View系列)

OAF学习笔记-深入ViewAction and Navigation Buttons

Action/Navigation Buttons 的作用:

  1. 在本页面内执行动作.
  2. 导航到另一个页面.
  3. 执行动作并导航到另一个页面.

Action/Navigation Buttons 的位置:

  1. 单一Text field, Poplist.
  2. 多个Item 组成的组
  3. 表格
  4. 整个页面

Action Buttons

当点击按钮时执行Page Post 动作

Create a 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); //实例化

 aa.setID("Go"); //定义ID

 aa.setUINodeName("xxSubmitButton"); //定义UINodename

 aa.setEvent("Go"); //定义事件名称

 aa.setText("Go"); //定义Prompt

 webBean.addIndexedChild(aa); //在页面上显示

注解: 此为动态生成item的通用例程,其中的setUINodeName 可省略,OAF会自动分配,最后一句是指定按钮在哪个Region中生成,这里是整个页面,如果有具体的Region 的话,应用下面的方法生成:

假设需要在一个TableLayoutRegion中生成一个按钮:

import oracle.apps.fnd.framework.webui.beans.layout.OATableLayoutBean;

OATableLayoutBean cont =(OATableLayoutBean)webBean.findIndexedChildRecursive("RepeatRN"); //实例化Region

OASubmitButtonBean aa = (OASubmitButtonBean)pageContext.getWebBeanFactory().createWebBean(pageContext,OAWebBeanConstants.BUTTON_SUBMIT_BEAN); //实例化按钮

 aa.setID("Go");

 aa.setUINodeName("xxSubmitButton");

 aa.setEvent("Go");

 aa.setText("abcd");

 cont.addIndexedChild(aa); //注意,用上面实例化的webbean对象的方法在页面上显示按钮

Control visual property (动态设置属性)

在运行时刻,只有一个属性可能需要更改,即为按钮的Prompt. 可调用setText 来实现(首先实例化按钮)

Control Behavior. and Data (行为和数据控制)

可用性: setDisabled(Boolean)  设置按钮不可用

校验:setUnvalidated(Boolean) 按钮点击后不触发onSubmit validationClient

            setServerUnvalidated(Boolean)  按钮点击后不触发onSubmit validationServer

Handle Button Press Events (获取按钮事件)

两种方式:

利用Page Post动作来获取

public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)

{

 ...  // Check to see if a submit button named "Go" has been pressed.

 if (pageContext.getParameter("Go") != null)

 {

 ...

利用FireAction 来获取

首先定义按钮的FireAction Event名称,然后再processFormRequest 中获取该事件

public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)

  {

    super.processFormRequest(pageContext, webBean);

    if (pageContext.getParameter(EVENT_PARAM).equals("Go"))

    {

      pageContext.getApplicationModule(webBean).invokeMethod("updatedata");

     

    }

  }

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10359218/viewspace-677443/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/10359218/viewspace-677443/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值