OAF更改动态头行

来源:互联网 发布:东方网络最新公告 编辑:程序博客网 时间:2024/05/16 11:20


选择头信息,动态刷新行信息。本文将详细介绍该种需求的做法。

本例沿用《OAF-头行结构》的am与vo,所以在进行本例之前,请先完成《OAF-头行结构》

一、创建页面

在test.oracle.apps.cux.detail下,点右键 New->Web Tier->OA Components->Page

确定

输入 Name:PPRDetailPG

Package:test.oracle.apps.cux.detail.webui

确定,生成页面

更改region1属性

ID:PageLayoutRN

AM Definition:test.oracle.apps.cux.ppr.server.DetailAM

Window Title:级联明细

Title: 级联明细

 

新建一个RN:QueryRN

选择PageLayoutRN,点右键,New->Region

更改以下信息

ID:QueryRN

Region Style:query

ConstructionMode:autoCustomizationCriteria

IncludeAdvanced Panel:True

 

 

用向导新建一个表格

右键点击QueryRN,New->RegionUsing Wizard...

ApplicationModule:test.oracle.apps.cux.details.server.DetailAM

AvailableView Usage:PoHeaderVO1

下一步

Region ID:PoHeaderTb

Region Style:table

下一步

选中PoheaderId,PoNumber,VendorName,VendorSiteCode,Viewline到右边

下一步,修改表格信息

完成

可以看到,结构图如下

修改ITEM的SearchAllowed全部为True

更改PoHeaderTb属性

Width:100%

 

 

添加查询条件

选择QueryRN,右键选New->simpleSearchPanel

系统会自动创建一个Header和一个Region

修改Header属性

ID:SimpleSearchHdr

TEXT:订单查询

修改Region属性

ID:SearchComponentLayout

 

然后在Region下面新建一个messageTextInput

修改ITEM的属性

ID:PoHeaderID

SearchAllowed:True

MaximumLength:40

Prompt:订单ID

Length:20

 

添加查询的对应关系

选择QueryRN,右键New->simpleSearchMappings

更改属性

ID:PoHeaderMap

Search Item:PoHeaderId

Results Item:PoHeaderId

添加查询的对应关系

选择QueryRN,右键New->simpleSearchMappings

更改属性

ID:PoHeaderMap

Search Item:PoHeaderId

Results Item:PoHeaderId

 

创建detail域

选择PageLayoutRN,点右键,New->Region,更改设置

Id:DetailRN

Region Style:header

Text: 行明细

选中DetailRN,点右键,New->RegionUsing Wizard...

ApplicationModule:test.oracle.apps.cux.details.server.DetailAM

AvailableView Usage:PolineVO1

下一步:Region Properties

Region ID:PoLineTb

Region Style:table

选中LineNum,ItemCode,ItemDescription到右边

下一步,修改表格属性

完成

 

更改表格属性,修改search_allowed全部为True

更改PoLineTb

Width:100%

 

选择PoHeaderTb,右键New->SingleSelection

修改multipleSelection1的属

ID:singleSelection

View Instance:PoHeaderVO1

ViewAttribute:Selectflag、

Action Type:firePartialAction

Event:cascadeDetail

 

运行看一下结果

 

 

 

二、创建CO

在PageLayoutRN上右击SetNew Controller

Package Name:test.oracle.apps.cux.detail.webui

Class Name: PPRDetailCO

确定,完成

在processFormRequest中加入如下代码

    public voidprocessFormRequest(OAPageContext pageContext,

                                   OAWebBeanwebBean) {

        super.processFormRequest(pageContext,webBean);

        OAApplicationModule am =

           (OAApplicationModule)pageContext.getApplicationModule(webBean);

        String event = pageContext.getParameter("event");

        if(event.equals("cascadeDetail")) {

            OAViewObject vo =(OAViewObject)am.findViewObject("PoHeaderVO1");

            Row masterRow =vo.getFirstFilteredRow("Selectflag", "Y");

            if (masterRow != null) {

               vo.setCurrentRow(masterRow);

            }

        }

}

运行看一下结果

选中头时,会自动刷新行信息。

0 0
原创粉丝点击