oracle-databaseoracle11goracle10goracleformsoracle-fusion-middleware

How to add counter on Button Oracle Forms


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


Solution

  • 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.