Download presentation
Presentation is loading. Please wait.
Published byClarissa Ellis Modified over 10 years ago
1
© 2005 SRP Computer Solutions, Inc., All Rights Reserved Extreme Makeover: Promoted Events Edition
2
SRP Computer Solutions, Inc. © 2005 SRP Computer Solutions, Inc., All Rights Reserved Events and Their Handlers Events and Event Handlers are different Events –Simple Notifications –No Processing attached Event Handlers –React to events –Execute functionality upon notification
3
SRP Computer Solutions, Inc. © 2005 SRP Computer Solutions, Inc., All Rights Reserved A Series of Events Chain of Events Script Events –Written in Form Designer System Events –Default behavior Quick Events –Pre-defined handlers –Set in Form Designer
4
SRP Computer Solutions, Inc. © 2005 SRP Computer Solutions, Inc., All Rights Reserved Event Flow
5
SRP Computer Solutions, Inc. © 2005 SRP Computer Solutions, Inc., All Rights Reserved Anatomy of a Script Event Written in Form Designer Stored in SYSREPOSWINEXES –APP*EVENT*FORM.CONTROL Examples –MY_APP*GOTFOCUS*MY_FORM.EDITLINE –MY_APP*CREATE*MY_FORM.
6
SRP Computer Solutions, Inc. © 2005 SRP Computer Solutions, Inc., All Rights Reserved Script Event Object Code Script Event reference stored in window Improves performance
7
SRP Computer Solutions, Inc. © 2005 SRP Computer Solutions, Inc., All Rights Reserved What is a Promoted Event? Passes through one handler for many or all windows and/or controls Allows global enhancements Stored in SYSREPOSWINEXES –APP*EVENT.CONTROL.OIWIN* Example –MY_APP*GOTFOCUS.EDITLINE.OIWIN* Inherited
8
SRP Computer Solutions, Inc. © 2005 SRP Computer Solutions, Inc., All Rights Reserved Promoted Event Flow
9
SRP Computer Solutions, Inc. © 2005 SRP Computer Solutions, Inc., All Rights Reserved Create an Opening for Promoted Events Find the event’s signature –(CtrlEntId, CtrlClassId, …)
10
SRP Computer Solutions, Inc. © 2005 SRP Computer Solutions, Inc., All Rights Reserved Write the Promoted Event Handler First two parameters must be: –CtrlEntId, CtrlClassId Remaining parameters must match event signature
11
SRP Computer Solutions, Inc. © 2005 SRP Computer Solutions, Inc., All Rights Reserved Copy Object Code to SYSREPOSEVENTEXES Use COPY_ROW RUN COPY_ROW "SYSOBJ", "$MY_PROMOTED_CREATE_EVENT*MYAPP", "SYSREPOSEVENTEXES", "MYAPP*CREATE..OIWIN*", 2, 0 Repeat for each Promoted Event handler Repeat whenever you recompile a handler
12
SRP Computer Solutions, Inc. © 2005 SRP Computer Solutions, Inc., All Rights Reserved Good Promoted Events Carpool Must use COPY_ROW method every time we make a change Redirect individual Promoted Event handlers to a single Promoted Event Commuter Module Remember to COPY_ROW one last time
13
SRP Computer Solutions, Inc. © 2005 SRP Computer Solutions, Inc., All Rights Reserved Promote that Event, General! 1.Open Event Designer 2.Set “Enforce” to Yes 3.Restart OpenInsight 4.Recompile all your windows
14
SRP Computer Solutions, Inc. © 2005 SRP Computer Solutions, Inc., All Rights Reserved Why do I have to Recompile Forms? Highest level handler stored in Window’s SYSREPOSWINEXES record If Promoted CREATE is highest: If CREATE Script Event is highest:
15
SRP Computer Solutions, Inc. © 2005 SRP Computer Solutions, Inc., All Rights Reserved Giving Promoted Events their Marching Orders 1.Create New General Entity 2.Select “Application Rows” 3.Set Entity to TABLENAME:KEY replacing “*” with “_” –Example: SYSREPOSEVENTEXES:MYAPP_CREATE..OIWIN_ 4.Set Title to whatever you want 5.Set Sub-Key to actual key –Example: MYAPP*CREATE..OIWIN*
16
SRP Computer Solutions, Inc. © 2005 SRP Computer Solutions, Inc., All Rights Reserved Demoted Events 1.Open Event Designer 2.Set “Enforce” to No 3.Restart OpenInsight 4.Recompile all your windows
17
SRP Computer Solutions, Inc. © 2005 SRP Computer Solutions, Inc., All Rights Reserved With Great Power comes Great Responsibility Keep them Generic –A few exceptions are okay Alternative way of capturing “Pre” events Useful for Global Configurations –Set control fonts and/or styles Never use them when writing third-party tools Don’t forget them when debugging
18
© 2005 SRP Computer Solutions, Inc., All Rights Reserved Thank You Any Questions?
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.