Oracle Forms之动态List Item Value
2015-05-14 16:52
501 查看
在Forms开发中,很多时候都会用到List提供特定的值给用户进行选择。
而本文讨论的是 如何动态的添加List的值。
原理就是通过record group
具体可参考官方文档:POPULATE_LIST Built-in
POPULATE_LIST Built-in
Description
Removes the contents of the current list and populates the list with the values from a record group. The record group must be created at runtime and it must have the following two column (VARCHAR2) structure:
Column 1: Column 2:
the list label the list value
Syntax
PROCEDURE POPULATE_LIST(list_id ITEM, recgrp_id RecordGroup);
PROCEDURE POPULATE_LIST(list_id ITEM, recgrp_name VARCHAR2);
PROCEDURE POPULATE_LIST(list_name VARCHAR2, recgrp_id RecordGroup);
PROCEDURE POPULATE_LIST(list_name VARCHAR2, recgrp_name VARCHAR2);
Built-in Type unrestricted procedure
Enter Query Mode yes
Parameters
list_id Specifies the unique ID that Oracle Forms assigns when it creates the list item. Use the FIND_ITEM built-in to return the ID to an appropriately typed variable. The data type of the ID is ITEM.
list_name The name you gave to the list item when you created it. The data type of the name is VARCHAR2.
recgrp_id Specifies the unique ID that Oracle Forms assigns when it creates the record group. The data type of the ID is RecordGroup.
recgrp_name The VARCHAR2 name you gave to the record group when you created it.
Usage Notes
Do not use the POPULATE_LIST built-in if the Mapping of Other Values property is defined and there are queried records in the block. Doing so may cause Oracle Forms to be unable to display records that have already been fetched.For example,
assume that a list item contains the values A, B, and C and the Mapping of Other Values property is defined. Assume also that these values have been fetched from the database (a query is open). At this point, if you populate the list using POPULATE_LIST, an
error will occur because Oracle Forms will attempt to display the previously fetched values (A, B, and C), but will be unable to because these values were removed from the list and replaced with new values.
Before populating a list, close any open queries. Use the ABORT_QUERY built-in to close an open query.
BEGIN
--RETRIEVE_LIST(list_id, 'RECGRP_ONE');
CLEAR_LIST('Block.Item_name');
POPULATE_LIST('Block.Item_name', 'Group_Name');
END;
而本文讨论的是 如何动态的添加List的值。
原理就是通过record group
具体可参考官方文档:POPULATE_LIST Built-in
POPULATE_LIST Built-in
Description
Removes the contents of the current list and populates the list with the values from a record group. The record group must be created at runtime and it must have the following two column (VARCHAR2) structure:
Column 1: Column 2:
the list label the list value
Syntax
PROCEDURE POPULATE_LIST(list_id ITEM, recgrp_id RecordGroup);
PROCEDURE POPULATE_LIST(list_id ITEM, recgrp_name VARCHAR2);
PROCEDURE POPULATE_LIST(list_name VARCHAR2, recgrp_id RecordGroup);
PROCEDURE POPULATE_LIST(list_name VARCHAR2, recgrp_name VARCHAR2);
Built-in Type unrestricted procedure
Enter Query Mode yes
Parameters
list_id Specifies the unique ID that Oracle Forms assigns when it creates the list item. Use the FIND_ITEM built-in to return the ID to an appropriately typed variable. The data type of the ID is ITEM.
list_name The name you gave to the list item when you created it. The data type of the name is VARCHAR2.
recgrp_id Specifies the unique ID that Oracle Forms assigns when it creates the record group. The data type of the ID is RecordGroup.
recgrp_name The VARCHAR2 name you gave to the record group when you created it.
Usage Notes
Do not use the POPULATE_LIST built-in if the Mapping of Other Values property is defined and there are queried records in the block. Doing so may cause Oracle Forms to be unable to display records that have already been fetched.For example,
assume that a list item contains the values A, B, and C and the Mapping of Other Values property is defined. Assume also that these values have been fetched from the database (a query is open). At this point, if you populate the list using POPULATE_LIST, an
error will occur because Oracle Forms will attempt to display the previously fetched values (A, B, and C), but will be unable to because these values were removed from the list and replaced with new values.
Before populating a list, close any open queries. Use the ABORT_QUERY built-in to close an open query.
设置List Item
1. 在Property Palette(key:F4)中设置<Item Type> 属性为List Item,<Subclass Information>为List新建Record Groups
2.Record Groups的数据来源,只能对应List的两列 也就是必须控制为两个栏位添加Triggers
3.在Block级或Item级的Trigger中添加如下代码:BEGIN
--RETRIEVE_LIST(list_id, 'RECGRP_ONE');
CLEAR_LIST('Block.Item_name');
POPULATE_LIST('Block.Item_name', 'Group_Name');
END;
相关文章推荐
- Adding Value To Combo List at Runtime in Oracle Forms
- Populate A List Item With Record Group In Oracle Forms Using Populate_List And Create_Group_From_Query Command
- Shifting List Item Values From One List To Another In Oracle Forms
- Populating Display Item Value On Query In Oracle Forms
- Populate A List Item With Record Group In Oracle Forms Using Populate_List And Create_Group_From_Query Command
- Adding List Item Element At Runtime In Oracle Forms
- WinForm CheckedBoxList Add Item and Value
- An Example of Pre-Query and Post-Query Triggers in Oracle Forms With Using Display_Item to Highlight Dynamically
- Examples For When-Validate-Item trigger In Oracle Forms
- 用Image作为List空间的ItemRender,滚动滚动条动态加载的问题
- 小程序API:wx.showActionSheet 将 itemList动态赋值
- Highlighting Text Item On Entry In Oracle Forms
- combox如何添加带Value和Text的item(类似webform中的listitem)
- Using SYSTEM.MOUSE_ITEM In Oracle Forms
- 如何在dropdownlist动态添加item之后,如何设置其value值! /用JS控制服务端dropDownlist和textField的Readonly属性
- Creating List Item in Oracle D2k
- Determining Current Block and Current Item in Oracle Forms
- 动态计算listview的高度listItem.measure(0, 0)报空指针异常解决办法
- java List<Item> its=new ArrayList<Item>(); Map按value中的某字段排序
- If Value Exists Then Query Else Allow Create New in Oracle Forms An Example