我创建了一个新表单,用户选择“CSV”文件,然后将“CSV”数据上传到oracle表单。我想当用户按下“UPLOAD”按钮然后在按钮上显示计数“UPLOAD [1]”。上传数据后,按钮进入禁用状态。删除数据时,再次“UPLOAD”进入启用状态。再次上传数据后按钮如“UPLOAD [2]”
我不知道如何在按钮上添加计数器。我搜索谷歌但没有找到。
我正在使用Oracle Forms 11gR2
您可以使用以下代码添加上传按钮:
declare
v_toggled pls_integer;
begin
insert into table1
values(1,0);
commit;
select count(*) into v_toggled from table1 where closed = 0;
if v_toggled >0 then
Set_Item_Property('push_button1',label,'upload'||'['||v_toggled||']');
end if;
Go_Item('another_item');
Set_Item_Property('push_button1',enabled,property_false);
end;
table1是通过create table table1( id int,closed int);
创建的
并在表单退出时应用update table1 set closed = 1
,并添加
Set_Item_Property('push_button1',enabled,property_true);
在另一个项目的代码中,您要刷新该按钮的活动性。
我想你只需要在代码中动态设置按钮的标签。例如
set_item_property('my_button',label,'UPLOAD ['|| my_counter ||']');
你可以查看这个other SO topic获得一些指导。
还可以使用Forms Builder脱机文档,因为您应该了解其中的所有内容。