Skip to Main Content

Oracle Forms

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

blink multiple fields, timer

user613563Aug 12 2023 — edited Aug 12 2023

hi

Calling A Timer from 2 triggers, WHEN-NEW-FORM-INSTANCE & WHEN-LIST-CHANGE to know the value for :prop_select

Declare
    timer_id  timer ;
Begin
   timer_id:=FIND_TIMER('FBLINK');
   IF NOT ID_NULL(    timer_id) THEN
      DELETE_TIMER(    timer_id);
   END IF;
    timer_id := Create_Timer( 'FBLINK', 200, REPEAT ) ;
  --tm:=CREATE_TIMER('VBLINK', 1000, REPEAT);
end;

WHEN-TIMER-EXPIRED

declare
    
    v_timer_name VARCHAR2(100);    

cursor c_tenant_rnw is select s.spec_part_no
from   tenant_contract r , dc_lease_txn d, inv_product_spec s
where  r.tenant_code = d.dc_lease_no
and    d.DC_LEASE_ITEM_CODE  = s.spec_id
and    s.spec_prod_code      = :prop_select;

returns the following data at the back end.
spec_part_no
F36
F73
O11

m_blk_fld varchar2(15);
begin
  v_timer_name :=GET_APPLICATION_PROPERTY (timer_name);
  if v_timer_name = 'FBLINK' THEN    
-- CODE1 - FILEDS DOES NOT BLINK
     Go_block('block3');
     for ix in c_tenant_rnw loop
         m_blk_fld := '''block3.'||ix.spec_part_no||'''';
            
       if Get_Item_Property(m_blk_fld, FOREGROUND_COLOR )
        != Get_Item_Property(m_blk_fld, BACKGROUND_COLOR ) Then
        Set_Item_Property(m_blk_fld, FOREGROUND_COLOR, Get_Item_Property(m_blk_fld, BACKGROUND_COLOR ) ) ;
     Else 
        Set_Item_Property(m_blk_fld, FOREGROUND_COLOR, 'r0g0b0' ) ;
     End if ;

/* CODE2 when i run the below piece of code individually for the 3 fields, F36, F73 & O11, they blinks perfectly
        -- FIELD F36
    If Get_Item_Property('block3.F36', FOREGROUND_COLOR )
           != Get_Item_Property('block3.F36', BACKGROUND_COLOR ) Then
       Set_Item_Property('block3.F36', FOREGROUND_COLOR, Get_Item_Property('block3.F36', BACKGROUND_COLOR ) ) ;
    Else
       Set_Item_Property('block3.F36', FOREGROUND_COLOR, 'r0g0b0' ) ;
    End if ;
        -- FIELD F73
    If Get_Item_Property('block3.F73', FOREGROUND_COLOR )
       != Get_Item_Property('block3.F73', BACKGROUND_COLOR ) Then
       Set_Item_Property('block3.F73', FOREGROUND_COLOR, Get_Item_Property('block3.F73', BACKGROUND_COLOR ) ) ;
    Else
      Set_Item_Property('block3.F73', FOREGROUND_COLOR, 'r0g0b0' ) ;
    End if ;
        -- FIELD F81
    If Get_Item_Property('block3.O11', FOREGROUND_COLOR )
       != Get_Item_Property('block3.O11', BACKGROUND_COLOR ) Then
       Set_Item_Property('block3.O11', FOREGROUND_COLOR, Get_Item_Property('block3.O11', BACKGROUND_COLOR ) ) ;
    Else
       Set_Item_Property('block3.O11', FOREGROUND_COLOR, 'r0g0b0' ) ;
    End if ;
*/
    next_record;
     end loop;
  end if

on my form control block (block3), there are about 100 fields having their names as F1,F2,F3… to F100.
i want to blink several fields of the block (block3) simultaneously, depending on the values getting return from the query.
the names of the fields of block3 are exactly the same as the rows retreived from query.

i want the WTE code to run as per CODE1 logic, and NOT individually as code2.

please if someone could help me correct my above code, i would appreciate that alot.
Thanks

Comments
Post Details
Added on Aug 12 2023
4 comments
217 views