您的位置:首页 > 数据库 > Oracle

Working With Push Buttons In Oracle Forms

2016-12-25 14:13 1731 查看
[align=justify]Managing push buttons at run time in Oracle Forms is very simple and in this tutorial you will learn to enable or disable the buttons, making visible and invisible buttons and will learn to change the label text of a button.[/align] [align=justify] [/align] [align=justify]In the below mentioned examples I am using toggle functionality for buttons, means if the button is enabled or visible then it will be disable or invisible by using Get_Item_Property and Set_Item_Property commands.[/align] [align=justify] [/align] [align=justify]Below is the screen shot of the form and you can download the form from the following link:[/align] [align=justify] Download Form[/align]

[align=justify] [/align] [align=justify]To perform this functionality I used buttons and written the When-Button-Pressed trigger to make the changes in other button's functionality.[/align]
The following is the code:

Making Button Toggle Enable / Disable

Begin
If Get_Item_Property('control.pb_endb', enabled) = 'FALSE' Then
Set_Item_Property('control.pb_endb', enabled, Property_True);
Else
Set_Item_Property('control.pb_endb', enabled, Property_False);
End if;
End;

Making Button Toggle Visible / Invisible

Begin
If Get_Item_Property('control.pbvs', Visible) = 'FALSE' Then
Set_Item_Property('control.pbvs', Visible, Property_True);
-- Make enable also
Set_Item_Property('control.pbvs', Enabled, Property_True);
Else
Set_Item_Property('control.pbvs', Visible, Property_False);
End if;
End;

Changing Label Text

Begin
If :control.txtbuttonlbl Is Not Null Then
Set_Item_Property('control.pblbl', Label, :control.txtbuttonlbl);
End if;
End;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: