|
|
Re: Cursor Control on Master/Detail Forms [message #615278 is a reply to message #615213] |
Sun, 01 June 2014 11:07 |
|
jwang02
Messages: 26 Registered: May 2014 Location: Indiana
|
Junior Member |
|
|
Littlefoot, thank you to point the direction for me.
I created WHEN-MOUSE-CLICK trigger on one of detail field for master record to change color:
SET_BLOCK_PROPERTY('MASTER',CURRENT_ROW_BACKGROUND_COLOR, 'r40g100b0');
GO_BLOCK('DETAIL2');
The record backgroung color on Master changed to green but all other records also changed to black(that's what I don't want).
And after the detail chahnges saved all fields changed to black too.
I'll try again but what's wrong?
[Updated on: Sun, 01 June 2014 17:48] Report message to a moderator
|
|
|
|
|
Re: Cursor Control on Master/Detail Forms [message #615440 is a reply to message #615427] |
Wed, 04 June 2014 01:15 |
|
Littlefoot
Messages: 21818 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
You mean, something like this?
Visual attribute of the DEPTNO item in a master block remains red although I moved to its detail block. Here's how:- I created two visual attributes: VA_RED (background set to "red") and VA_NORMAL (didn't touch anything)
- I also created a parameter: CUR_DEPT_REC which will hold current record position
- PRE-RECORD trigger on the DEPT block:
:parameter.cur_dept_rec := :system.trigger_record;
set_item_instance_property('dept.deptno', :parameter.cur_dept_rec, visual_attribute, 'va_red');
- POST-RECORD trigger on the DEPT block:
set_item_instance_property('dept.deptno', current_record, visual_attribute, 'va_normal'); - POST-BLOCK trigger on the DEPT block:
set_item_instance_property('dept.deptno', :parameter.cur_dept_rec, visual_attribute, 'va_red');
That should do it.
|
|
|
Re: Cursor Control on Master/Detail Forms [message #615606 is a reply to message #615440] |
Thu, 05 June 2014 22:39 |
|
jwang02
Messages: 26 Registered: May 2014 Location: Indiana
|
Junior Member |
|
|
Hi Littlefoot,
I'm dealing with multiple things, and just got time to back to this one.
Thank you so much for your example. It works out for me now.
The only thing I don't like is : when cursor backs from the detail record to another master record, there are two red DEPTNOs showing up.
Hopefully, I can get rid of the first one.
Thanks again for your help.
[Updated on: Thu, 05 June 2014 22:45] Report message to a moderator
|
|
|
|
Re: Cursor Control on Master/Detail Forms [message #615815 is a reply to message #615611] |
Mon, 09 June 2014 08:30 |
|
jwang02
Messages: 26 Registered: May 2014 Location: Indiana
|
Junior Member |
|
|
It worked out and the bug got fixed. Thanks, Littlefoot! I do appreciate your guide.
The code I put on PRE-BLOCK trigger is:
IF :parameter.cur_dept_rec <> :system.trigger_record THEN
set_item_instance_property('Dept.Deptno', :parameter.cur_master_rec, visual_attribute, 'VA_NORMAL');
END IF;
[Updated on: Mon, 09 June 2014 08:32] Report message to a moderator
|
|
|
|
|
|
|