Page 1 of 1

Navigate Canvas items

Posted: Wed Jul 05, 2006 9:32 am
by Kashif
Asslam-o-Alaikum Dear all Memebrs.

In a FORM i have many Items Like
Display Items, Text Items, Radio Button, Push Buttons etc.

I want to navigate all Items the VIA LOOP.
and want to Change the Properties of Some Items of TYPE DISPALY ITEM.

How can i do this?



Best Regards.

Muhammad Kashif

Posted: Wed Jul 05, 2006 9:42 am
by admin
Display items don't have navigation property.

Posted: Wed Jul 05, 2006 9:58 am
by Kashif
Sorry Little Mistake in presenting my Problem.

I want to Find all the Display Item using a LOOP (RUN TIME).
and then Want to Change its Proprty. for example changing its FOREGROUND color.



Best Regards.

Muhammad Kashif

Posted: Thu Jul 06, 2006 5:05 am
by admin
You can't get focus of an item which don't have navigation properties.thanks

Posted: Thu Jul 06, 2006 5:40 am
by Kashif
[quote]You can't get focus of an item which don't have navigation properties.thanks

<i><div align="right">Originally posted by admin

Posted: Thu Jul 06, 2006 8:43 am
by mirza_rehan
Here is sample code for yours required task, hope it will help you. I assue first item is button and this trigger code put on that buttion

<b>Declare
v_NxtItm Varchar2(30) := :System.Trigger_Item;
Begin
Loop
v_NxtItm := Get_Item_Property(v_NxtItm,NextItem);
if Get_Item_Property(v_NxtItm,Item_Type) = 'DISPLAY ITEM' then
Set_Item_Property(v_NxtItm,Visual_Attribute,'DI_VA');
End If;
Exit When
Get_Block_Property(:System.Trigger_Block,Last_Item) = v_NxtItm;
End Loop;
End;</b>


Second option use this code on <b>WHEN-NEW-FORN-INSTANCE</b>

<b>Declare
v_NxtItm Varchar2(30) := Get_Block_Property('B1',First_Item);
Begin
Loop
if Get_Item_Property(v_NxtItm,Item_Type) = 'DISPLAY ITEM' then
Set_Item_Property(v_NxtItm,Visual_Attribute,'DI_VA');
End If;
Exit When
Get_Block_Property(:System.Trigger_Block,Last_Item) = v_NxtItm;
v_NxtItm := Get_Item_Property(v_NxtItm,NextItem);
End Loop;
End;</b>

if any problem exist please reply

take care
Allah Hafiz

Best regards,
R E H A N M I R Z A
System Analyst / Senior Oracle Developer
Cell: +92-304-2120807

When ever you pray
Please remember me and my family

Posted: Fri Jul 07, 2006 6:21 am
by Kashif
Thanx Mirza sb.

Both are working Fine.

how can i check what value or text is in the Display item.

Best Regards.

Muhammad Kashif

Posted: Fri Jul 07, 2006 6:47 am
by admin
This is nice that your problem is resolved. thanks to Rehan.

Posted: Fri Jul 07, 2006 7:22 am
by mirza_rehan
check this code , Bold letter are solved yours new requirement

Declare
v_NxtItm Varchar2(30) := Get_Block_Property('B1',First_Item);
v_Val Varchar2(50);
Begin
Loop
if Get_Item_Property(v_NxtItm,Item_Type) = 'DISPLAY ITEM' then
<b>v_Val := Name_In(v_NxtItm);
Message(v_Val);</b>
Set_Item_Property(v_NxtItm,Visual_Attribute,'DI_VA');
End If;
Exit When
Get_Block_Property(:System.Trigger_Block,Last_Item) = v_NxtItm;
v_NxtItm := Get_Item_Property(v_NxtItm,NextItem);
End Loop;
End;

take care

Best regards,
R E H A N M I R Z A
System Analyst / Senior Oracle Developer
Cell: +92-304-2120807

When ever you pray
Please remember me and my family