Home » Developer & Programmer » Forms » Cursor Control on Master/Detail Forms (Oracle Forms 10g)
Cursor Control on Master/Detail Forms [message #615211] Sat, 31 May 2014 21:07 Go to next message
jwang02
Messages: 26
Registered: May 2014
Location: Indiana
Junior Member
How to keep a field highlighted on a master form displaying multiple records
when navigating out to its child records on detail forms?

[Updated on: Sat, 31 May 2014 21:56]

Report message to a moderator

Re: Cursor Control on Master/Detail Forms [message #615213 is a reply to message #615211] Sat, 31 May 2014 23:34 Go to previous messageGo to next message
Littlefoot
Messages: 21805
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Try to set its visual attribute.
Re: Cursor Control on Master/Detail Forms [message #615278 is a reply to message #615213] Sun, 01 June 2014 11:07 Go to previous messageGo to next message
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 #615301 is a reply to message #615278] Mon, 02 June 2014 00:11 Go to previous messageGo to next message
Littlefoot
Messages: 21805
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Your question was "How to keep a field highlighted?" so - why did you use SET_BLOCK_PROPERTY? Try with SET_ITEM_PROPERTY instead.
Re: Cursor Control on Master/Detail Forms [message #615427 is a reply to message #615301] Tue, 03 June 2014 23:11 Go to previous messageGo to next message
jwang02
Messages: 26
Registered: May 2014
Location: Indiana
Junior Member
Hi Littlefoot,

Actually I tried SET_*_PROPERTY/SET_ITEM_INSTANCE_PROPERTY with different trigers, and non of them worked out correctly.
Right now I don't know if I did sth wrong or it's a bug(sb said).
Did you really worked on this issue? Can you post a simple example?

Thank you for your help.
Re: Cursor Control on Master/Detail Forms [message #615440 is a reply to message #615427] Wed, 04 June 2014 01:15 Go to previous messageGo to next message
Littlefoot
Messages: 21805
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
You mean, something like this?

/forum/fa/11915/0/

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 Go to previous messageGo to next message
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 #615611 is a reply to message #615606] Thu, 05 June 2014 23:37 Go to previous messageGo to next message
Littlefoot
Messages: 21805
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Try PRE-BLOCK on the master block; as the parameter contains a record number, with IF - THEN - ELSE set records to VA_NORMAL if their record number doesn't match parameter's value.
Re: Cursor Control on Master/Detail Forms [message #615815 is a reply to message #615611] Mon, 09 June 2014 08:30 Go to previous messageGo to next message
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

Re: Cursor Control on Master/Detail Forms [message #615900 is a reply to message #615815] Tue, 10 June 2014 22:43 Go to previous messageGo to next message
Arslan
Messages: 42
Registered: March 2014
Location: Pakistan
Member
Dear Little Foot,


Will you provide a .fmb file for above example.


Thanks
Re: Cursor Control on Master/Detail Forms [message #615908 is a reply to message #615900] Wed, 11 June 2014 01:29 Go to previous messageGo to next message
Littlefoot
Messages: 21805
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I don't have it. What prevents you from creating it yourself? It is a simple master-detail form based on Scott's EMP and DEPT tables. Instructions for highlighting are described within this discussion.
Re: Cursor Control on Master/Detail Forms [message #615922 is a reply to message #615908] Wed, 11 June 2014 04:13 Go to previous messageGo to next message
Arslan
Messages: 42
Registered: March 2014
Location: Pakistan
Member
Thanks for your reply


if you don't have it than please provide me complete coding of these triggers and way to create it thanks in advance.


Thanks
Re: Cursor Control on Master/Detail Forms [message #615925 is a reply to message #615922] Wed, 11 June 2014 04:23 Go to previous message
cookiemonster
Messages: 13915
Registered: September 2008
Location: Rainy Manchester
Senior Member
LF did provide the complete coding
Previous Topic: Report Parameter Form
Next Topic: image rotating
Goto Forum:
  


Current Time: Tue Mar 19 04:06:19 CDT 2024