Home » Developer & Programmer » Forms » blink multiple fields, timer (forms6i, windows)
blink multiple fields, timer [message #688023] Fri, 11 August 2023 16:02
rhnshk
Messages: 26
Registered: May 2008
Junior Member
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 ) ;
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 the names from F1 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


[Updated on: Sat, 12 August 2023 02:45]

Report message to a moderator

Previous Topic: Tabular Form fill data from cursor
Next Topic: Debug Assertion Failed / assertion failed ifdbg60.exe error
Goto Forum:
  


Current Time: Sat Dec 21 19:16:32 CST 2024