DATA(ITEM) colour in form... [message #263167] |
Wed, 29 August 2007 04:37 |
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 #263232 is a reply to message #263167] |
Wed, 29 August 2007 08:16 |
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 |
|
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
[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 #263511 is a reply to message #263394] |
Thu, 30 August 2007 04:05 |
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 #263555 is a reply to message #263167] |
Thu, 30 August 2007 06:08 |
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 #263815 is a reply to message #263167] |
Fri, 31 August 2007 01:59 |
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 #264452 is a reply to message #264288] |
Mon, 03 September 2007 07:04 |
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
|
|
|