List of Values (LOV)

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. 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章