0
votes

I create a new form in which user select "CSV" File then upload "CSV" data into oracle forms. I want when user press the "UPLOAD" Button then show count on Button Like "UPLOAD [1]". After upload data then button goes to disable. When delete data then again "UPLOAD" goes to enable. After again upload data then button like "UPLOAD [2]"

I don't know how to add counter on button. I search on google but nothing found.

I am using Oracle Forms 11gR2

2

2 Answers

2
votes

You can add an upload button with the code :

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;

where table1 is created through create table table1( id int,closed int);

and apply update table1 set closed = 1 during the exit from the form, and add

  Set_Item_Property('push_button1',enabled,property_true);

in the code of an other item where you want to refresh the activeness of that button.

0
votes

I think you just have to set the button's label dynamically in your code. e.g.

set_item_property('my_button', label, 'UPLOAD ['||my_counter||']');

You can check this other SO topic for some guidance.

Also use the Forms Builder offline documentation as everything you should know about is in it.