ITPub博客

首页 > Linux操作系统 > Linux操作系统 > OAF学习笔记-深入View之Action and Navigation Buttons(深入View系列)

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

原创 Linux操作系统 作者:asiaidea 时间:2010-11-04 18:44:42 0 删除 编辑

OAF学习笔记-深入View之Action 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 的话,应用下面的方法生成:

假设需要在一个TableLayout的Region中生成一个按钮:

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 validation(Client)

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

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博客 ” ,链接:https://blog.itpub.net/10359218/viewspace-677443/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: Forms 开发小贴士
请登录后发表评论 登录
全部评论

注册时间:2010-11-04

  • 博文量
    140
  • 访问量
    519109