Home » Developer & Programmer » Forms » DATA(ITEM) colour in form...
DATA(ITEM) colour in form... [message #263167] Wed, 29 August 2007 04:37 Go to next message
musman
Messages: 147
Registered: July 2007
Location: Lahore
Senior Member

in my tabular form am showing all records at run time.
is it possible that when i select specific record that item colour will change.. like
form showing record like
------
213 ALI 2398-09-8 Y
324 ASAD 654-098-0 N
122 MARTIN 7645-0 Y
------
if my cursor position is on 324 then.form should look like
213 ALI 2398-09-8 Y
324 ASAD 654-098-0 N
122 MARTIN 7645-0 Y

-------------
Am using Forms 6i..
Re: DATA(ITEM) colour in form... [message #263208 is a reply to message #263167] Wed, 29 August 2007 07:03 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Have you set the Current record visual attribute?

MHE
Re: DATA(ITEM) colour in form... [message #263225 is a reply to message #263208] Wed, 29 August 2007 07:41 Go to previous messageGo to next message
musman
Messages: 147
Registered: July 2007
Location: Lahore
Senior Member

No i did`nt
can u explain a bit ..or give an example
how 2 use visual attribute for this ..

[Updated on: Wed, 29 August 2007 07:53]

Report message to a moderator

Re: DATA(ITEM) colour in form... [message #263232 is a reply to message #263167] Wed, 29 August 2007 08:16 Go to previous messageGo to next message
Flyhard
Messages: 21
Registered: April 2007
Location: Germany
Junior Member
You need to use a timer to do this.

add the CREATE_TIMER to the POST_QUERY trigger of the block

In the WHEN-TIMER-EXPIRED Trigger you need to go though all records and set their visual attribute.

Warning: If you have many records, this will take a long time.
Re: DATA(ITEM) colour in form... [message #263344 is a reply to message #263232] Wed, 29 August 2007 15:08 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
A timer? Why?

Here's how Mr. Hereijgers would do that:

- use data block wizard to create a dummy form based on Scott's DEPT table
- create a new visual attribute whose name is VA_RED_RECORD and Foreground Color is set to "red"
- open DEPT block property palette and set Current Record Visual Attribute Group to "VA_RED_RECORD"
- compile and run form; the result is: current record color changes to red

/forum/fa/2958/0/


[EDIT - @musman, please, stop using IM language]

[Updated on: Wed, 29 August 2007 15:10]

Report message to a moderator

Re: DATA(ITEM) colour in form... [message #263394 is a reply to message #263232] Wed, 29 August 2007 23:26 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
I think Flyhard is just 'pulling your chain'. You don't use timers in the post_query.

If you want fields to have a different colour when they are NOT the current record then in the post_query you use the 'set_item_instance_property' to change the 'visual_attribute'. You would do this, for example, to make a negative value 'red', versus the normal positive value 'black'.

David
Re: DATA(ITEM) colour in form... [message #263411 is a reply to message #263344] Thu, 30 August 2007 00:14 Go to previous messageGo to next message
musman
Messages: 147
Registered: July 2007
Location: Lahore
Senior Member

Thanks
@littlefoot
IT works..
Re: DATA(ITEM) colour in form... [message #263435 is a reply to message #263344] Thu, 30 August 2007 01:21 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Littlefoot wrote on Wed, 29 August 2007 22:08
Here's how Mr. Hereijgers would do that:

You must have one of these: http://www.orafaq.com/forum/fa/1659/0/

Very Happy Good explanation, Littlefoot!

MHE
Re: DATA(ITEM) colour in form... [message #263511 is a reply to message #263394] Thu, 30 August 2007 04:05 Go to previous messageGo to next message
Flyhard
Messages: 21
Registered: April 2007
Location: Germany
Junior Member
djmartin wrote on Thu, 30 August 2007 06:26
I think Flyhard is just 'pulling your chain'. You don't use timers in the post_query.

If you want fields to have a different colour when they are NOT the current record then in the post_query you use the 'set_item_instance_property' to change the 'visual_attribute'. You would do this, for example, to make a negative value 'red', versus the normal positive value 'black'.

David


I was not pulling his chain. The set_item_property needs to be called from somewhere, and I found that the post-query trigger in combination with a timer s the best solution to this...
Re: DATA(ITEM) colour in form... [message #263531 is a reply to message #263511] Thu, 30 August 2007 04:36 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Are you serious? Why would you use a timer?

MHE
Re: DATA(ITEM) colour in form... [message #263555 is a reply to message #263167] Thu, 30 August 2007 06:08 Go to previous messageGo to next message
Flyhard
Messages: 21
Registered: April 2007
Location: Germany
Junior Member
Because I cannot use "NEXT_ITEM" in the POST-QUERY Trigger - and I do not know what items will be in the Block since this changes frequently - and this way we do not have to change the code when we add items to the block.
Re: DATA(ITEM) colour in form... [message #263722 is a reply to message #263555] Thu, 30 August 2007 20:11 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Why do you need a 'next_item' in the 'Post-Query' as it fires for every record?

David
Re: DATA(ITEM) colour in form... [message #263815 is a reply to message #263167] Fri, 31 August 2007 01:59 Go to previous messageGo to next message
Flyhard
Messages: 21
Registered: April 2007
Location: Germany
Junior Member
I need to color each cell seperately. The Block in question is a statusmatrix and each cell means either OK (no color), Failure (red) or some other notable event has happend. If we only needed to color rows, it might be enought to color the row, but we need to do it on cell level...

If you know a trigger that is fired for each cell of a block after the query, I'd love to change my code to make it easier to understand.

Re: DATA(ITEM) colour in form... [message #264288 is a reply to message #263815] Sun, 02 September 2007 21:12 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
The Post-Query trigger fires after each row is retrieved. To test and set each 'item' you would traverse the record, typically starting from the first navigable item of the record through to the last navigable item and use the 'set_item_instance_property' to change the visual attribute property of that 'item'.

David
Re: DATA(ITEM) colour in form... [message #264452 is a reply to message #264288] Mon, 03 September 2007 07:04 Go to previous message
Flyhard
Messages: 21
Registered: April 2007
Location: Germany
Junior Member
OK. You convinced me that yours is the better approach.

Here is what I did with your suggestion:

DECLARE
	subtype item_name_t	IS varchar2(60);
	v_first_item			item_name_t;
	v_wert						varchar2(20);
	v_item_name				item_name_t;
	c_prefix		CONSTANT varchar2(30) := :SYSTEM.TRIGGER_BLOCK||'.';
BEGIN
	v_first_item := GET_BLOCK_PROPERTY(:SYSTEM.TRIGGER_BLOCK,FIRST_ITEM);
	v_item_name := c_prefix||v_first_item;
	WHILE v_item_name != c_prefix
	LOOP
		v_wert := NAME_IN(v_item_name);
		SUB_MATRIX_COLORS(v_wert,v_item_name);
		v_item_name := c_prefix||GET_ITEM_PROPERTY(v_item_name, NEXTITEM);
	END LOOP;
END;

[Updated on: Mon, 03 September 2007 07:04]

Report message to a moderator

Previous Topic: Is oracle application server is necessary to run oracle forms?
Next Topic: Calender Error
Goto Forum:
  


Current Time: Sun Feb 02 18:52:42 CST 2025