Creating Dynamic LOV in Oracle D2k Forms
2016-12-25 18:40
1271 查看
Dynamic Lov is a good idea for the form where too many Lov requirement is there with different record groups. In this blog you will learn create dynamic Lov step by step.
See also:
http://www.foxinfotech.in/2015/01/populate-list-with-recordgroup-in-oracle-forms.html
http://www.foxinfotech.in/2013/04/adding-value-combolist-runtime-oforms.html
http://www.foxinfotech.in/2013/03/when-validate-item-trigger-oracle-forms.html
http://www.foxinfotech.in/2012/11/creating-list-item-in-oracle-d2k_9366.html
Step-1 Create a Single Lov (you can give any name)[/b]
1. Click on form builder navigator Lovs node and then click on Add button. Select create lov manually option from the window.
Step-2 Create Record Group (you can give any name)[/b]
2. Click on form builder navigator Record Groups and then click on Add button and set the properties and query as displayed in below image.
[align=center][/align] [align=center][/align] [align=center][/align]
Step-3 Create Parameters[/b]
3. Click on Parameter node and then click on Add button and create 4 Char type Parameters as displayed below:
[align=left] [/align] [align=left]Step-4 Set Lov Properties[/b][/align] [align=left]4. Set the lov properties as show below:[/align] [align=center] [/align]
Step-5 Set Lov Column Mapping Properties [/b]
5. Set the Lov's Column Mapping Properties with the parameters as show below:
Step-6 Create a procedure to populate lov [/b]
[/b]PROCEDURE call_dynlov (IGroupName in Varchar2)
IS
blov boolean;
begin
:parameter.lovcol1 := null;
:parameter.lovcol2 := null;
:parameter.lovcol3 := Null;
:parameter.lovcol4 := Null;
set_lov_property('dynlov', group_name, IgroupName);
set_lov_property('dynlov', position, (get_application_property(display_width)-600)/2,
(get_application_property(display_height)-250)/2-50);
blov := show_lov('dynlov');
if not blov then
message('Value not choosen.');
end if;
end;
Finally Call to this Lov with the following code:[/b]
DECLARE
rg_name VARCHAR2(40) := 'YrGroup';
rg_id RecordGroup;
errcode NUMBER;
BEGIN
rg_id := Find_Group( rg_name );
--- Create group with 4 column because we already set the lov property for 4 cols, these 3 and 4 cols will --- be not mapped to any fields
if not id_null(rg_id) then
delete_group(rg_id);
end if;
rg_id :=
Create_Group_From_Query( rg_name, 'select main_menu_name col1, sub_menu_name col2, ''3'' col3, ''4'' col4 from
fox_main_menu a, fox_sub_menu b
where a.main_menu_code = b.main_menu_code order by 1,2');
--- call the procedure
call_dynlov(rg_name);
if :parameter.lovcol1 is not null then
--- if lov selected and parameter 1 value is not null then map to field
:fox_user_prog.mmn := :parameter.lovcol1;
:Fox_user_prog.smn := :parameter.lovcol2;
end if;
END;
See also: Oracle Forms Recipes
Like us to get notifications for free source code in future, thanks.
[align=left][/align] [align=left]
Dynamic LOV in Oracle Forms
Reviewed by Joseph on
Feb 10
Rating:
5[/align]
See also:
http://www.foxinfotech.in/2015/01/populate-list-with-recordgroup-in-oracle-forms.html
http://www.foxinfotech.in/2013/04/adding-value-combolist-runtime-oforms.html
http://www.foxinfotech.in/2013/03/when-validate-item-trigger-oracle-forms.html
http://www.foxinfotech.in/2012/11/creating-list-item-in-oracle-d2k_9366.html
Step-1 Create a Single Lov (you can give any name)[/b]
1. Click on form builder navigator Lovs node and then click on Add button. Select create lov manually option from the window.
Step-2 Create Record Group (you can give any name)[/b]
2. Click on form builder navigator Record Groups and then click on Add button and set the properties and query as displayed in below image.
[align=center][/align] [align=center][/align] [align=center][/align]
Step-3 Create Parameters[/b]
3. Click on Parameter node and then click on Add button and create 4 Char type Parameters as displayed below:
[align=left] [/align] [align=left]Step-4 Set Lov Properties[/b][/align] [align=left]4. Set the lov properties as show below:[/align] [align=center] [/align]
Step-5 Set Lov Column Mapping Properties [/b]
5. Set the Lov's Column Mapping Properties with the parameters as show below:
Step-6 Create a procedure to populate lov [/b]
[/b]PROCEDURE call_dynlov (IGroupName in Varchar2)
IS
blov boolean;
begin
:parameter.lovcol1 := null;
:parameter.lovcol2 := null;
:parameter.lovcol3 := Null;
:parameter.lovcol4 := Null;
set_lov_property('dynlov', group_name, IgroupName);
set_lov_property('dynlov', position, (get_application_property(display_width)-600)/2,
(get_application_property(display_height)-250)/2-50);
blov := show_lov('dynlov');
if not blov then
message('Value not choosen.');
end if;
end;
Finally Call to this Lov with the following code:[/b]
DECLARE
rg_name VARCHAR2(40) := 'YrGroup';
rg_id RecordGroup;
errcode NUMBER;
BEGIN
rg_id := Find_Group( rg_name );
--- Create group with 4 column because we already set the lov property for 4 cols, these 3 and 4 cols will --- be not mapped to any fields
if not id_null(rg_id) then
delete_group(rg_id);
end if;
rg_id :=
Create_Group_From_Query( rg_name, 'select main_menu_name col1, sub_menu_name col2, ''3'' col3, ''4'' col4 from
fox_main_menu a, fox_sub_menu b
where a.main_menu_code = b.main_menu_code order by 1,2');
--- call the procedure
call_dynlov(rg_name);
if :parameter.lovcol1 is not null then
--- if lov selected and parameter 1 value is not null then map to field
:fox_user_prog.mmn := :parameter.lovcol1;
:Fox_user_prog.smn := :parameter.lovcol2;
end if;
END;
See also: Oracle Forms Recipes
Like us to get notifications for free source code in future, thanks.
[align=left][/align] [align=left]
Dynamic LOV in Oracle Forms
Reviewed by Joseph on
Feb 10
Rating:
5[/align]
相关文章推荐
- How to get the query statement of LOV in Oracle Form
- Creating Dynamic Web Project using Maven in Eclipse
- Using GET_APPLICATION_PROPERTY in Oracle D2k Forms
- Creating List Item in Oracle D2k
- Reading Csv Files with Text_io in Oracle D2k Forms
- DISPLAY_ITEM built-in in Oracle D2k Forms
- Silent install Oracle 10.2 in W2k8 - GetProcessImageFileNameW not in dynamic link library PSAPI.DLL
- CHECKBOX_CHECKED built-in in Oracle D2k Forms
- Creating Excel File in Oracle Forms
- Creating Custom Login Screen In Oracle Forms 10g
- How To Tune or Test PLSQL Code Performance in Oracle D2k Forms
- Dynamic SQL Using OPEN FOR in Oracle PL/SQL
- Display LOV (List Of Values) Using Show_Lov In Oracle Forms
- Creating, Stopping, Re-Starting and Deleting a Timer in Oracle Forms
- Creating a Stored Procedure or Function in an Oracle Database
- Creating dynamic/configurable parameterized queries in Entity Framework
- 184 You are in the process of creating a Virtual Private Catalog (VPC) in your Oracle Database 11g d
- Creating Timer in Oracle D2k / Forms 6i and Displaying a Clock
- Creating and Using Temporary Tables in Oracle
- Creating Dynamic View Object at Runtime programmatically - Oracle ADF