Home » Developer & Programmer » Forms » change current item visual attrib
change current item visual attrib [message #223782] Sun, 11 March 2007 07:25 Go to next message
vdsk
Messages: 41
Registered: February 2006
Location: India & UAE
Member
I have multi row block in Enter Query mode . I want to change current item background color. I have put when-new-items-instance trig at form level; code is Set_Item_instance_Property(:SYSTEM.CURRENT_ITEM, CURRENT_RECORD, VISUAL_ATTRIBUTE, 'VA_GREEN'); and post-text-item trig as
Set_Item_instance_Property(:SYSTEM.CURRENT_ITEM, CURRENT_RECORD, VISUAL_ATTRIBUTE, 'VA_WHITE');
This works when form is under query executing mode (after I press F8)..

But at the time of entering query criteria all navigated items change to VA_GREEN.
How to arrest this ??
I am using Forms 6i
Re: change current item visual attrib [message #223800 is a reply to message #223782] Sun, 11 March 2007 13:06 Go to previous messageGo to next message
Littlefoot
Messages: 20896
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
WHEN-NEW-ITEM-INSTANCE trigger should be an item-level trigger, not form-level one. Move it to desired item and, I believe, everything will be fine.
Re: change current item visual attrib [message #223832 is a reply to message #223800] Sun, 11 March 2007 23:31 Go to previous messageGo to next message
vdsk
Messages: 41
Registered: February 2006
Location: India & UAE
Member
Hi...
thanx for ur suggn ..but this means if I have 20 items in block
then I have to put trig for each item??
Well, I tried it anyway but with same result...
My prob is in Enter-query mode only where all navigated items turn Green and stays the same..
I tried it like this in both trigs ,when-new-item-instance and post-text-item but no luck...

IF :System.Mode = 'ENTER-QUERY' THEN
Set_Item_instance_Property(:SYSTEM.CURRENT_ITEM, CURRENT_RECORD, VISUAL_ATTRIBUTE, 'VAPREV');
end if;

any more suggns plz..?
Re: change current item visual attrib [message #223883 is a reply to message #223832] Mon, 12 March 2007 03:25 Go to previous messageGo to next message
Littlefoot
Messages: 20896
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Well, I tried that too; using the WHEN-NEW-ITEM-INSTANCE trigger at item level worked fine for me.

P.S. I forgot to mention: I used Oracle Forms Developer 10g, as I don't have 6i to test it. Perhaps that makes the difference (but, sincerely, I don't think so).

[Updated on: Mon, 12 March 2007 03:26]

Report message to a moderator

Re: change current item visual attrib [message #223896 is a reply to message #223883] Mon, 12 March 2007 03:59 Go to previous messageGo to next message
vdsk
Messages: 41
Registered: February 2006
Location: India & UAE
Member
I tried it at item level also for 2 -3 items in block..
Infact both trigs When-new-item-instance & post-text..
But still same ..that is..all navigated items -when i am in ENTER-QUERY mode turns GREEN..but it works as expected in execute-query mode..!! I even tried with system.mode variable in both trigs..

post-text-item:
Set_Item_instance_Property(:SYSTEM.CURRENT_ITEM, CURRENT_RECORD, VISUAL_ATTRIBUTE, 'VA_WHITE');

when-new-item-instance:
Set_Item_instance_Property(:SYSTEM.CURRENT_ITEM, CURRENT_RECORD, VISUAL_ATTRIBUTE, 'VA_GREEN');

But I have an application -ORION- here in Forms6i where it
happens. Badluck no fmb's..
Hope I can try & sort it out...

Thanks..
Change current item visual attrib-in ENTER-QUERY mode [message #223941 is a reply to message #223883] Mon, 12 March 2007 06:05 Go to previous messageGo to next message
vdsk
Messages: 41
Registered: February 2006
Location: India & UAE
Member
Hi all..
Let me pinpoint my problem. I want to change color of the current item to Green in ENTER-QUERY mode. And all other items must be in White. So once I press enter or click to an item it should turn Green and the previous one should change back to default (or White in my case). I have defined the required VA's. I have When-new-item-instance trigger at Form level which turns the navigated item to Green. But the post-text-item at Form level is not returning the prev item to default. This is bcoz Post-text-item does not fire in Enter-query mode...
So which triggr or what other way to accomplish the color change back to default...??
Re: Change current item visual attrib-in ENTER-QUERY mode [message #225431 is a reply to message #223941] Mon, 19 March 2007 23:25 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Have you solved your problem?

David
Re: Change current item visual attrib-in ENTER-QUERY mode [message #225441 is a reply to message #225431] Mon, 19 March 2007 23:38 Go to previous messageGo to next message
vdsk
Messages: 41
Registered: February 2006
Location: India & UAE
Member
Got some sample codes from other sites..Trying them now...Will put up here surely whatever the result is...

thanks
Re: Change current item visual attrib-in ENTER-QUERY mode [message #225694 is a reply to message #225441] Wed, 21 March 2007 00:36 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
If you want a trigger to fire in Enter-Query mode then you have to change the 'Fire in Enter-Query Mode' to 'Yes'. When a trigger is created this parameter is defaulted to 'No'.

By the way, have a good look at the block and item property 'Current Record Visual Attribute Group'.

David
Previous Topic: Query in detail block
Next Topic: Hide check box if not needed
Goto Forum:
  


Current Time: Tue Dec 06 12:34:34 CST 2016

Total time taken to generate the page: 0.15666 seconds