List of Values (LOV)

来源:互联网 发布:js print setup 插件 编辑:程序博客网 时间:2024/05/29 06:44

List of Values (LOV)

Overview

As described in Oracle Browser Look-and-Feel (BLAF) UI Guideline: LOV (List of Values) 

就如Oracle Browser Look-and-Feel (BLAF) UI的指导方针,LOV (List of Values) ,是一个可以让用户在一个预定义的值集(list of value)里选择,目的就是返回一个或多个值到基础页面里;以下的LOV类型的具体实现会在后面描述:

1Text Field LOV  文本框LOV 

2Dependent LOV Text Field 依赖LOV 文本框

3LOV Choice List   LOV下拉框

4Multiselect LOV (For a Table)   多选LOV(表格)

5Multiselect LOV (For a Single Field)  多选择LOV(单一值)

 

 

[ OTN Version ], a 

List of Values (LOV) is a special control that lets users choose a value from a predefined list of values for the 

purpose of populating one or more fields on a page. 

Implementation details for the following LOV types are described below. 

y Text Field LOV 

y Dependent LOV Text Field 

y LOV Choice List 

y Multiselect LOV (For a Table) 

y Multiselect LOV (For a Single Field) 

An LOV Primer

LOV的入门

Before learning how to implement a List of Values, it's important to understand its key components and 

在学习如果实现一个LOV之前,了解它的控件和行为是很重要的,这里只是简要的描述,后面会有各种LOV类型的详细实现细节

1、Base Page and LOV Window  基础页面和LOV窗口

2、LOV MAPPING

3、Dependent LOVs 依赖LOV

4、Validation (Also Known as "Autocompletion")  校验LOVs,人所共知的自动完成框

5、自动清除

behavior. This section briefly describes each of the following; implementation-level details are provided below 

for different LOV types. 

y Base Page and LOV Window 

y LOV Mappings 

y Dependent LOVs 

y Validation (Also Known as "Autocompletion") 

y AutoClear 

Base Page and LOV Window

基础页面和LOV窗口

A base page includes an LOV control in its page layout. For example, Figure 1 illustrates a "Purchase Order" 

一个基础页面在页面布局里包括了一个LOV控件,例如,在图1所看的”Purchase Order”LOV域,当用户点击灯图标,就会显示如图2所示的LOV窗口。用户可以通过LOV指定的查询条件进行查询,可以从结果中选择一行记录,并将值传入基础页面(你也可以配置为传多个值到基础页面的多个控件)

 

LOV field. When the user selects the flashlight icon, the LOV window shown in Figure 2 displays. The user 

optionally searches within the LOV using designated query criteria, and selects a row from the results list to 

populate the value(s) in the base page (you can configure your LOV to return multiple values to different base 

page items). 

Figure 1: Buyer, Supplier and Supplier Site text field LOVs. 

Figure 2: An LOV window with Advanced Search enabled 

374

LOV Mappings

LOV Mappings define the data communication between the base page the and LOV window. An LOV map is 

comprised of the following participants: 

LOV Mapping 是 基础页面和LOV窗口之间的交流,一个LOV Mapping包括了如下主要内容

 

LOV Item

The item in the LOV for which the mapping is defined. 

LOV窗口里需要配对到基础页面的ITEM

(Base Page) Criteria

When the user invokes a List of Values, one or more field values from the base page can be passed to the 

当用户进入一个LOV,一个或者多个值可以从基础窗口传入到LOV窗口,从面做为一个查询条件的值(注意:在基础页面的LOV 域应该被配置为一个查询条件),当LOV窗口弹出来后,查询结果就会显示出来(已经根据传进入的值进行过滤),例如:在上面的定单例子中,如果用户在输入Purchase Order里输入2,并点击了LOV图标,LOV窗口就会显示所有以2开头的定单;

如果你需要用代码来显示查询(例如,你需要得到基础页面的值,并指定给哪个查询条件),然后你一定要配置LOV去接受被动的条件,这个条件是与LOV查询条件相耦合,你要用代码来联合起来

 

LOV to be used as search criteria (note that the LOV field on the base page should alwaysbe configured as a 

search criteria item). When the LOV window renders, the query results are displayed. For example, in the 

purchase order example above, if the user enters "2" in the "Purchase Order" field and selects the LOV icon, 

the query will return all purchase orders whose number starts with "2." 

If you need to programmatically control the query criteria (for example, you need to intercept base page values 

to ascertain what the real query criteria should be), then you must configure the LOV to accept passive criteria, 

which is loosely defined to mean any LOV query criteria that you specify programmatically in an associated 

LOV controller. 

(Base Page) Result 

(基础页面)结果

When the user selects a row in the LOV, one or more values are returned to the base page. In the ToolBox 

Tutorial Application example shown in Figure 1 above, each of the user-friendly "Buyer," "Supplier" and 

"Supplier Site" LOV fields also have hidden primary keys. When the user selects a value from the LOV, the OA 

Framework copies both the user-friendly name and the primary key values to the base page. 

Figure 3: XML page structure showing the Buyer, Supplier and Supplier Site LOV fields and the corresponding 

hidden primary key fields. 

当用户在LOV窗口选择了一条记录,一个或者多个就会返回到基础页面,在上面图1ToolBox 

Tutorial Application的例子里,"Buyer," "Supplier" and "Supplier Site"都有一个友好的隐藏值,当用户在LOV窗口选择了一条记录,OAF就会复制名字和所对应的键到基础页面

 

 

375

Dependent LOVs

依赖LOVs

You can also configure an LOV value to depend on a value from another field(s). For example, in the ToolBox 

Tutorial Application example shown above, the user cannot select a supplier site value until a supplier is 

selected, so the "Supplier Site" LOV is configured to depend on the "Supplier" value. 

你也可以配置一个LOV去依赖其他域。例如,在上面的ToolBox Tutorial Application 例子,只有用户选择了供应商,才能选择供应商地址,所以"Supplier Site" LOV 在配置为依赖”Supplier”  

 

Validation (Also Known As "Autocompletion")

校验(众所周知的自动填充)

LOVs can be configured to automatically validate data that the user enters without invoking the LOV window 

unless required. For example, if partial page rendering (PPR) is enabled and the user enters the value "Smi" in 

a Buyer name field and then tabs out, the OA Framework automatically queries all buyers whose name begins 

with "Smi." 

 

LOVs 可以配置成:用户输入信息而不需要打开LOV窗口;例如,如果PPR是可以的,用户在购买者里输入Smi,并按下tab键,OAF就会自动查询所有以Smi开始的购习者

(注意,如果PPR是不可以的,那就会出错,OAF在这情况下会刷新整个页面

 

Note: PPR does not work with pages that have errors on them; the OA Framework resorts to a full page 

refresh in these cases. 

 

y If a single match is found, the OA Framework automatically populates the result field(s). 

1、如果只找到一个结果,OAF就自动填充结果值

2、如果找到多个结果,OAF会显示LOV窗口让用户选择

3、如果没有找到结果,OAF会显示LOV窗口让用户选择不同的查询条件

 

y If multiple matches are found, the OA Framework displays the LOV window so the user can try different 

search criteria. 

y If no matches are found, the OA Framework displays the LOV window so the user can try different 

search criteria. 

Validate-On-Submit

提交时校验

The OA Framework also automatically validates hidden formValueLOV result fields when the page form is 

submitted (note that you can declaratively disable this for formValuefields and enable it for displayed LOV 

fields also). 

当页面表单提交时,OAF会自动校验隐藏的LOV值(注意:你也可以显式关闭这功能,也可以为显示的LOV域打开这功能)

 

第二去检查对如下原因是很重要的:

1、如果PPR是关闭的,当用户输入值并按下tab后,校验是没有效果的,没有结果会显示出来

2、就算LOV窗口已经打开,但用户直接关闭窗口而不是选择结果,同时也是返回空值

3、如果用户在LOV域输入值,没有按下TAB键就提交,校验也是没有用的

 

 

This second level of checking is important for the following reasons: 

y If PPR is disabled, validation is simply not performed when the user enters a value and tabs out; no 

other result fields will be populated. 

y Even if validation causes the LOV window to open, if the user cancels out without making a selection, 

376

the result fields will still be empty. 

y If the user enters a value in the LOV field and immediately selects a submit button, link or icon without 

tabbing out first, regular validation is not performed. 

When validate-on-submit is enabled, the LOV behaves almost exactly the same as it does when performing 

the standard validation: 

如果提交检验是开启的,LOV行为与标准行为是一样的:

1、如果只找到一条结果,OAF就会自动输入结果

2、如果找到多条结果,OAF就会在基础页面显示错误信息

3、如果没有找到结果,OAF就会在基础页面显示错误信息

y If a single match is found, the OA Framework automatically populates the result field(s). 

y If multiple matches are found, the OA Framework displays an error message at the top of the base 

page. 

y If no matches are found, the OA Framework displays an error message at the top of the base page. 

Passive Criteria

被动标准

Previously, LOVs with passive criteria could not be properly validated. Even if a single valid match was found 

for the given criteria, the OA Framework displayed the LOV window so the user could select the single 

matching value. Now, even LOVs with passive criteria can be validated (assuming you enable validation on the 

LOV field as described in the implementation details below). 

以前,有被动标准的LOVs是没有校验的,即使根据查询条件只找到一个结果,OAF会显示LOV窗口给用户去选择一个结果;现在,被动标准的LOVs是可以检验的(假设你在LOV域开启了上面所说功能)

 

AutoClear

自动清除

The OA Framework automatically clears dependent fields when the user changes the LOV value. 

y First, if the user changes a value of the LOV field, or any criteria items for the LOV, and tabs out, the 

OA Framework clears all associated result field values. 

 

当用户改变LOV的值,OAF会自动清除依赖的域

一,如果用户改变LOV域的值,或者LOV的查询条件,按下TABOAF也会清除LOV的值

二,如果用户改变LOV的值或者按下TABOAF会清除LOV域的值

注意:自动清除会消除级联的LOV,例如,假设如果改变查询条件的值,并按下TABOAF会清除关联的LOV,相反,会清除所有关联的结果;如果一些结果域被指定为不同LOV的值,LOV输入框同时也会被清除,直接所有的关联的LOV都清除了才会停止

警告:如果LOV结果被设置为messageStyledText ,自动清除会没有用;

 

y Second, if the user changes the value of an LOV criteria field and tabs out, the OA Framework clears 

the LOV field value. 

Note that AutoClear cascades throughout LOV relationships. For example, assume the user changes the value 

of a criteria field and tabs out. The OA Framework clears the corresponding LOV input field, and in turn, clears 

all related results fields. If any of these result fields are designated as a criteria for different LOV field, that LOV 

input will also be cleared along with its result fields. This continues until all related LOV items have been 

cleared. 

Warning: If an LOV result is written to a messageStyledTextitem, AutoClear cannot clear this field. 

0 0
原创粉丝点击