oracle developer build forms ii vol 2 ig - m087521

264
....................................................................................... 44112GC10 Production 1.0 May 1999 M08752 Oracle Developer: Build Forms II Volume 2 • Instructor Guide

Upload: rafael-narvaez

Post on 25-Nov-2015

152 views

Category:

Documents


15 download

DESCRIPTION

Practice Solutions for Oracle Developer Build Forms II Vol 1

TRANSCRIPT

  • .......................................................................................

    44112GC10Production 1.0May 1999M08752

    Oracle Developer: Build Forms II

    Volume 2 Instructor Guide

  • AuthorMark Sullivan

    Technical Contributors and ReviewersLouise BarnfieldGunnar BoehrsJacquelyn BrucePhyllis ChanBulent CinarkayaLaurent DereacMark DoranGillian EliasTushar GadhiaStephen GramannNancy GreenbergUrsula HovyUwe JentzschLeta A. JohnsonJan KeubenSteve LiretteJayne MarlowRita MorinDaphne NougierChristin NowakowskiBryan RobertsBert SalygaHelene SchwannHiroyuki SugiyamaPal TarcsayBart Van der LaarJack Walsh

    PublisherKelly LeeSherry Polm

    Copyright Oracle Corporation, 1999. All rights reserved.

    This documentation contains proprietary information of Oracle Corporation. It isprovided under a license agreement containing restrictions on use and disclosureand is also protected by copyright law. Reverse engineering of the software isprohibited. If this documentation is delivered to a U.S. Government Agency of theDepartment of Defense, then it is delivered with Restricted Rights and thefollowing legend is applicable:

    Restricted Rights LegendUse, duplication or disclosure by the Government is subject to restrictions forcommercial computer software and shall be deemed to be Restricted Rightssoftware under Federal law, as set forth in subparagraph (c) (1) (ii) of DFARS252.227-7013, Rights in Technical Data and Computer Software (October 1988).This material or any portion of it may not be copied in any form or by any meanswithout the express prior written permission of the Worldwide Education Servicesgroup of Oracle Corporation. Any other copying is a violation of copyright law andmay result in civil and/or criminal penalties.

    If this documentation is delivered to a U.S. Government Agency not within theDepartment of Defense, then it is delivered with Restricted Rights, as defined inFAR 52.227-14, Rights in Data-General, including Alternate III (June 1987).The information in this document is subject to change without notice. If you findany problems in the documentation, please report them in writing to EducationProducts, Oracle Corporation, 500 Oracle Parkway, Box 659806, RedwoodShores, CA 94065. Oracle Corporation does not warrant that this document iserror-free.

    Oracle Developer, Oracle Server, and PL/SQL are trademarks or registeredtrademarks of Oracle Corporation.

    All other products or company names are used for identification purposes only,and may be trademarks of their respective owners.

  • .....................................................................................................................................................

    Oracle Developer: Build Forms II iii

    .....................................................................................................................................................

    Contents

    PrefaceProfile xvRelated Publications xviTypographic Conventions xvii

    Lesson 1: Managing Projects with Project BuilderIntroduction 1-3Introducing Project Builder 1-5Project Builder Terminology 1-7Project Builder Benefits 1-9Project Builder User Interface 1-11Project Builder User Interface 1-13Creating Projects and Subprojects 1-15Adding Project Files 1-17Subdirectories Added as Subprojects 1-19Creating Connections 1-21Working with Project Files 1-23Establishing Dependencies 1-25Building Projects 1-27Delivering Projects 1-29Summary 1-33Practice Session Overview: Lesson 1 1-35Practice 1 1-36

    Lesson 2: Creating a Menu ModuleIntroduction 2-3Components of the Menu Module 2-5The Default Menu 2-7The Menu Editor 2-9Creating a Menu Module 2-11Module Properties 2-13Menu Properties 2-15Menu Item Properties 2-17Menu Item Types 2-19

  • .....................................................................................................................................................

    iv Oracle Developer: Build Forms II

    .....................................................................................................................................................

    Contents

    Menu Item Command Types 2-21Implementing Menu Toolbars 2-23Storing the Menu Module 2-25Attaching the Menu Module 2-27Pop-up Menus 2-29Summary 2-31Practice Session Overview: Lesson 2 2-33Practice 2 2-34

    Lesson 3: Managing Menu ModulesIntroduction 3-3Using PL/SQL in Menu Item Code 3-5Useful Built-in Menu Subprograms 3-7Showing and Hiding the Current Menu 3-9Managing Menu Security 3-11Defining Security Roles 3-13Assigning Access to Menu Items 3-15Summary 3-17Practice Session Overview: Lesson 3 3-19Practice 3 3-20

    Lesson 4: Programming Function KeysIntroduction 4-3Key Triggers 4-5Defining Key Triggers 4-7Characteristics of Key Triggers 4-9Classification of Key Triggers 4-11Using Key Triggers 4-15Association with Other Interface Controls 4-17Summary 4-19Practice Session Overview: Lesson 4 4-21Practice 4 4-22

  • .....................................................................................................................................................

    Oracle Developer: Build Forms II v

    .....................................................................................................................................................

    Contents

    Lesson 5: Responding to Mouse EventsIntroduction 5-3What Are Mouse Events? 5-5Responding to Mouse Movement 5-7Responding to Mouse Button Actions 5-11Summary 5-17Practice Session Overview: Lesson 5 5-19Practice 5 5-20

    Lesson 6: Controlling Windows and Canvases ProgrammaticallyIntroduction 6-3Using Window-Interaction Triggers 6-5Built-ins for Manipulating Windows 6-7Built-ins for Manipulating Canvases 6-9Working with Tab-Style Canvases 6-11Windows and Blocks 6-15Manipulating Window Properties Programmatically 6-17Showing Multiple Windows 6-19Closing Windows 6-21Blocks with Many Items 6-23Summary 6-25Practice Session Overview: Lesson 6 6-27Practice 6 6-28

    Lesson 7: Defining Data SourcesIntroduction 7-3Data Source Types 7-5Basing a Data Block on a FROM Clause Query 7-7Basing a Data Block on a Stored Procedure 7-9Example of a Query Using a REF Cursor Procedure 7-11Example of Query Using a Table of Records Procedure 7-13Example of DML Using a Stored Procedure 7-15Deciding Whether to Use a REF Cursor or a Tableof Records 7-17

  • .....................................................................................................................................................

    vi Oracle Developer: Build Forms II

    .....................................................................................................................................................

    Contents

    Data Block Wizard 7-19Data Block Properties 7-21Data Source Guidelines 7-23Summary 7-27Practice Session Overview: Lesson 7 7-29Practice 7 7-30

    Lesson 8: Working with Oracle8 Objects in Form BuilderIntroduction 8-3What Are Object Types? 8-5Review of Objects 8-7Object REFs 8-9Supported Oracle8 Features 8-11How Oracle Developer Treats Objects 8-13Object Type Displays 8-15Creating Data Blocks Based on Oracle8 Objects 8-17Selecting Object Table Columns 8-19Selecting Object Column Attributes 8-21Blocks with REF Lookups 8-23The REF Column Value 8-25LOVs for REFs 8-27Summary 8-29Practice Session Overview: Lesson 8 8-31Practice 8 8-32

    Lesson 9: Controlling Data Block RelationshipsIntroduction 9-3Creating a Relation 9-5Block Coordination 9-7Coordinate Blocks Using REFs 9-9Characteristics of Relation-Handling Triggers 9-11Principles of Relation-Handling Code 9-13Obtaining Relation-Handling Information 9-15Implementing a Coordination-Type Toggle 9-17

  • .....................................................................................................................................................

    Oracle Developer: Build Forms II vii

    .....................................................................................................................................................

    Contents

    Forcing a Commit Per Master 9-19Summary 9-21Practice Session Overview: Lesson 9 9-23Practice 9 9-24

    Lesson 10: Building Multiple Form ApplicationsIntroduction 10-3OPEN_FORM to Invoke Additional Forms 10-5Closing Forms 10-7Navigating Between Forms 10-9Transaction Processing for Opened Forms 10-11CALL_FORM to Invoke Additional Forms 10-13Transaction Processing for Called Forms 10-15NEW_FORM to Invoke Additional Forms 10-19Controlling Open Forms and Called Forms Together 10-21Different Ways of Invoking Forms 10-23Using Form Parameters 10-25Parameter Lists 10-29Creating and Manipulating Parameter Lists 10-31Passing Data Between Forms 10-33Summary 10-35Practice Session Overview: Lesson 10 10-37Practice 10 10-38

    Lesson 11: Working with Record GroupsIntroduction 11-3Record Groups 11-5Using Record Groups 11-7Defining Record Groups at Design Time 11-9Built-in Functions for Controlling Record Groups 11-11Defining Query Record Groups Programmatically 11-17Defining Nonquery Record Groups Programmatically 11-19Manipulating Record Group Rows 11-21Manipulating Selected Record Group Rows 11-23

  • .....................................................................................................................................................

    viii Oracle Developer: Build Forms II

    .....................................................................................................................................................

    Contents

    Defining Global Record Groups 11-25Manipulating List Items Programmatically 11-27Implementing Dynamic List Items 11-29Adding Values to Combo Boxes 11-31Summary 11-33Practice Session Overview: Lesson 11 11-35Practice 11 11-36

    Lesson 12: Including Charts and ReportsIntroduction 12-3Including Charts by Using the Chart Wizard 12-5Chart Item Properties 12-11Reporting Within Form Builder 12-13Report Object Properties 12-15Working with Reports 12-17Summary 12-21Practice Session Overview: Lesson 12 12-23Practice 12 12-24

    Lesson 13: Applying TimersIntroduction 13-3Timers 13-5Handling Timer Expiration 13-7Creating a Timer 13-9Modifying a Timer 13-11Deleting a Timer 13-13Summary 13-15Practice Session Overview: Lesson 13 13-17Practice 13 13-18

    Lesson 14: Using Server Features in Form BuilderIntroduction 14-3Using Oracle Server Functionality in Forms 14-5Dealing with PL/SQL Code 14-7

  • .....................................................................................................................................................

    Oracle Developer: Build Forms II ix

    .....................................................................................................................................................

    Contents

    PL/SQL8 Support 14-9New PL/SQL8 Scalar Data Types 14-11Unsupported Client-Side PL/SQL8 Features 14-13Handling Errors Raised by the Oracle Server 14-15Performing DDL with FORMS_DDL 14-19Using FORMS_DDL 14-21Summary 14-23Practice Session Overview: Lesson 14 14-25Practice 14 14-26

    Lesson 15: Using Reusable ComponentsIntroduction 15-3Reusable Components 15-5Reusable Components List 15-7The Calendar Class 15-11Calendar Object Group Content 15-13Built-in for Manipulating the Calendar 15-15Summary 15-17Practice Session Overview: Lesson 15 15-19Practice 15 15-20

    Appendix A: Practice SolutionsPractice 1 Solutions A-2Practice 2 Solutions A-5Practice 3 Solutions A-9Practice 4 Solutions A-12Practice 5 Solutions A-16Practice 6 Solutions A-18Practice 7 Solutions A-21Practice 8 Solutions A-25Practice 9 Solutions A-29Practice 10 Solutions A-34Practice 11 Solutions A-36Practice 12 Solutions A-42

  • .....................................................................................................................................................

    x Oracle Developer: Build Forms II

    .....................................................................................................................................................

    Contents

    Practice 13 Solutions A-45Practice 14 Solutions A-49Practice 15 Solutions A-55

    Appendix B: Table Descriptions and DataSummit Sporting Goods Database Diagram B-2S_CUSTOMER Description B-3S_CUSTOMER Data B-4S_DEPT Description and Data B-8S_EMP Description B-9S_EMP Data B-10S_ITEM Description B-13S_ITEM Data B-14S_ORD Description and Data B-16S_PRODUCT Description B-17S_PRODUCT Data B-18S_REGION Description and Data B-22S_TITLE Description and Data B-23Oracle8 objects: types, tables B-24

    Appendix C: Project Builder AddendumIntroduction C-3Team Development with Project Builder C-5Generating and Printing Project Reports C-11Defining New Module Types C-13Identifying New Module Types C-15Describing New Module Types C-17Actions for New Module Types C-19An Icon for New Module Types C-21Modifying Types Using Actions C-23Customizing Actions by Using Macros C-25Customizing the Launcher C-29Inheritance in Project Builder C-31Actions C-33

  • .....................................................................................................................................................

    Oracle Developer: Build Forms II xi

    .....................................................................................................................................................

    Contents

    Summary C-35

    Appendix D: Introduction to Oracle8 Object FeaturesIntroduction D-3New Oracle8 Data Types D-5Object Types D-7Creating Oracle8 Objects D-11Object Columns D-13Object Views D-15INSTEAD-OF Triggers D-17Referencing Objects D-19Displaying Oracle8 Objects in the Object Navigator D-21Summary D-29

    Appendix E: Menu Run-Time ParametersIntroduction E-3Substitution Parameters E-5Defining a User-Named Substitution Parameter E-7Substitution Parameter Built-ins E-9Validating a Substitution Parameter Value E-11Summary E-13

    Appendix F: Handling Server-Side ErrorsIntroduction F-3Obtaining the Cause of Declarative-Constraint Violations F-5Customizing Oracle Server Error Messages F-7Example Procedure for Handling Oracle Server Errors F-9Summary F-13

    Appendix G: EMP_PKG PackagePackage Specification G-2Package Body G-4

    Appendix H: Working with ActiveX ControlsIntroduction H-3

  • .....................................................................................................................................................

    xii Oracle Developer: Build Forms II

    .....................................................................................................................................................

    Contents

    What Are VBX, OCX, and ActiveX Controls? H-5Comparison of VBX, OCX, and ActiveX Controls H-7ActiveX in Form Builder H-9Implementing an ActiveX Control H-11Inserting an ActiveX Control in an ActiveX Control Item H-13Importing ActiveX Control Methods and Events Packages H-15Setting and Getting ActiveX Control Properties H-17Invoking ActiveX Control Methods H-21Responding to ActiveX Control Events H-23Handling Exceptions H-25Registering an ActiveX Control H-27Summary H-29

    Appendix I: Using Oracle Server Roles at Run TimeUsing Oracle Server Roles at Run Time I-3Procedures for Managing Roles I-7

    Appendix J: Instructor NoteIntroduction J-2How the Project Is Organized J-3Project Setup J-4Launching the Files J-8

  • ................................

    A

    Practice Solutions

  • A-2 Developer/2000: Build Forms II......................................................................................................................................................

    ......................................................................................................................................................

    Appendix A: Practice Solutions

    Practice 1 Solutions1 Create a connection to the database.

    a Create a new connection.File>New>Connection

    b Name the connection SUMMIT and specify the connect string. Your instructor should provide this information.Enter the title, username, password, and database.

    2 Create an initial project.a Create a new project (use the Project Wizard).

    Tools>Project Wizardb Name the project Oracle Developer: Build Forms II. Assign to this

    project the connection created earlier, and save it as summit.upd in the Lab directory. Do not add files to this project.Enter a Project Registry Filename of summit.upd in the Lab subdirectory and click Next. Enter a Title of Oracle Developer: Build Forms II. Enter a Project Directory of the Lab subdirectory and click Next. Select Summit as the Pre-Defined Connection and click Next. Click Next to skip the Author and Comments fields. Select Create an empty project and click Finish.

    3 Create a subproject and add files to it.a Using the Project Wizard, create a subproject named Summit

    Application that belongs to Oracle Developer: Build Forms II.Select the project node in the Project Navigator. Select Tools>Project Wizard in the main menu. Select Create a sub-project under an existing project and click Next. Click Next to accept Oracle Developer: Build Forms II as the Parent Project. Enter Summit Application as the Title. Enter the Lab subdirectory as the Project Directory and click Next. Select Summit as the Pre-Defined Connection and click Next. Click Next to skip the Author and Comments fields.

    b From the labs directory, add:- baseball.tif- calendar.pll- copy.ico

  • Developer/2000: Build Forms II A-3......................................................................................................................................................

    ......................................................................................................................................................

    Practice 1 Solutions

    - customers.fmb- Form_Builder_II.olb- pr11_2f.txt- pr7_3a.sql

    Click Finish to accept Select files to add to a project. The Add Files to Project dialog box appears. Select the files and press Enter.

    c Give a file items a more meaningful title.In the Project Navigator, select the pr11_2f.txt file and change the name of its entry to Delete Record Group Script. Examine the Property Palette for the item and note that the Filename property has not changes.

    4 Explore the Project Navigator.a Examine the state of the Project Navigator. Note that Project Builder

    has added executable versions of the Oracle source files that you added to the project.There is no formal solution.

    b Turn off the Show Implicit Items option. Note what happens to the Project Navigator display.Select Tools>Preferences>Navigator and clear the Show Implied Items check box.

    c Experiment with Project Builders different views.Select the different views under the Navigator menu.

    5 Deliver the project.a Invoke the Delivery Wizard and deliver all files.

    Select Tools>Deliver Wizard from the main menu. Select the name of the project from the list, select the Deliver all files option, and click the Next button.

    b Create Oracle Installer scripts on your local file system.Select the Deliver locally and create Oracle Installer scripts option, enter the destination subdirectory, and click on the Next button. Name the Script Summit_Install, and use the Summit program group. Do not ship the Oracle Developer Runtime environment with the installation. Click the Next button to continue.

  • A-4 Developer/2000: Build Forms II......................................................................................................................................................

    ......................................................................................................................................................

    Appendix A: Practice Solutions

    c Include all the deliverable files in the project.Click the Next button to accept the default list of files.

    d Accept the default delivery directories.Click the Next button to accept the default delivery directories.

    e Do not set any environmental variables upon installation.Click the Next button to continue.

    f Verify the settings, and finish the delivery.Click the Finish button.

    If you have time...6 Create a subproject from a subdirectory and add files to it.

    Using the Project Wizard, create a subproject named Lab_Sol that belongs to Oracle Developer: Build Forms II . Automatically include all files in that subdirectory.In the Project Navigator, select the name of the project that you just created. From the menu, select Project> Add Directory to Project. Select the Lab_Sol subdirectory and click the OK button.

  • Developer/2000: Build Forms II A-5......................................................................................................................................................

    ......................................................................................................................................................

    Practice 2 Solutions

    Practice 2 Solutions1 Create a new menu module.

    a Using the following screenshot as a guideline, create a new menu module called M_SUMMIT.

    Select the Menus node in the Object Navigator and click the Create tool. Invoke the Menu Editor. This automatically creates the main menu. Change the name of the menu to MAIN_MENU.Rename the menu item New Item to File. Click New Item twice to obtain the text cursor. Erase the old name. Enter the name: File.Create new menu items under File. Click File. Click the Create Down tool. Change the name. Set the properties as follows:

  • A-6 Developer/2000: Build Forms II......................................................................................................................................................

    ......................................................................................................................................................

    Appendix A: Practice Solutions

    File Menu

    Note the exact names of the Main Menu, and each its menu items. These will be needed in a later exercise.Create a new menu item to the right of File and rename it Edit. Click the File menu item. Click the Create Right tool. Name the new menu item Edit.Create new menu items under Edit. Click Edit. Click the Create Down tool. Change the name. For each of the items, set the properties as follows:

    Edit Menu

    Label

    Menu Item Type

    Command Type

    Menu Item Code

    Visible in Menu

    Visible in Horiz. Menu Toolbar

    Icon Filename

    Save Plain PL/SQL DO_KEY(COMMIT_FORM);

    Yes Yes Save

    Clear Plain PL/SQL DO_KEY(CLEAR_FORM);

    Yes Yes Abort

    Null1 Separator Null Yes Yes

    Exit Plain PL/SQL DO_KEY(EXIT_FORM);

    Yes Yes Exit

    Null2 Separator Null No Yes

    LabelMenu Item Type

    Magic Item

    Command Type

    Visible in Menu

    Visible in Horiz. Menu Toolbar

    Icon Filename

    Cut Magic Cut Null Yes Yes Cut

    Copy Magic Copy Null Yes Yes Copy

  • Developer/2000: Build Forms II A-7......................................................................................................................................................

    ......................................................................................................................................................

    Practice 2 Solutions

    Create a new menu item to the right of Edit and rename it Sort By. Click Edit. Click the Create Right tool. Rename the new menu item Sort By.Create three new menu items under Sort By. Click Sort By. Click the Create Down tool. Change the name. Set additional properties as follows:

    Sort By Menu

    Create a new menu to the right of Sort By and rename it Query. See the previous solution.Create two new menu items under Query. See the previous solution. Set the properties as follows:

    Paste Magic Paste Null Yes Yes Paste

    Null3 Separator Null No Yes

    Menu Label

    Menu Item Type

    Menu Item Radio Group

    Command Type Menu Item Code

    Order Id Radio Order_By PL/SQL SET_BLOCK_PROPERTY(s_ord, order_by, id ) ;

    Customer Id Radio Order_By PL/SQL SET_BLOCK_PROPERTY(s_ord, order_by,customer_id ) ;

    Sales Rep Id Radio Order_By PL/SQL SET_BLOCK_PROPERTY(s_ord, order_by,sales_rep_id ) ;

    LabelMenu Item Type

    Magic Item

    Command Type

    Visible in Menu

    Visible in Horiz. Menu Toolbar

    Icon Filename

  • A-8 Developer/2000: Build Forms II......................................................................................................................................................

    ......................................................................................................................................................

    Appendix A: Practice Solutions

    Query Menu

    b Save as M_SUMMIT and compile the menu module.c Attach the menu module to the ORDERS form.

    Open the ORDERS form and set the Menu Module property to M_SUMMIT for the form module.

    d Save and compile the form module.e Run and test the ORDERS form.

    2 Add pop-up menus to the CUSTOMERS form.a Open the CUSTOMERS form module.b Copy the EDIT_MENU menu from the M_SUMMIT menu module to the

    CUSTOMERS form. Attach this pop-up menu to the Comments item.Select EDIT_MENU from the M_SUMMIT menu module.Click the right mouse button and select Copy.Select the Pop-up Menus node from the CUSTOMERS formmodule.Click the right mouse button and select Paste.Select this pop-up menu in the Popup Menu property for the Comments item.

    c Save and compile the form module.

    LabelMenu Item Type

    Command Type Menu Item Code

    Visible in Horiz. Menu Toolbar

    Icon Filename

    Enter Query

    Plain PL/SQL DO_KEY(ENTER_QUERY);

    Yes query

    eXe-cute Query

    Plain PL/SQL DO_KEY(EXECUTE_QUERY);

    Yes execute

  • Developer/2000: Build Forms II A-9......................................................................................................................................................

    ......................................................................................................................................................

    Practice 3 Solutions

    Practice 3 Solutions1 Define a check menu item.

    a Open the M_SUMMIT menu module and create a new menu item to the right of Query and rename it Image.See previous solution.

    b Create a new menu item under Image and name it Image Activate. See previous solution.Set the properties as follows:

    c Import the text for the Image Activate menu item by using the pr3_1c.txt file. The menu item name must be IMAGE_ACTIVATE.In the PL/SQL Editor, select File->Import Text. Import the H:\Lab\pr3_1c.txt file.

    DECLARE product_image_id ITEM := FIND_ITEM(s_item.product_image ); image_description_id ITEM := FIND_ITEM(s_item.image_description); image_button_id ITEM := FIND_ITEM(control.image_button );BEGIN IF GET_ITEM_PROPERTY(product_image_id,displayed) = TRUE THEN SET_ITEM_PROPERTY( product_image_id, DISPLAYED, PROPERTY_FALSE); SET_ITEM_PROPERTY( image_description_id, DISPLAYED, PROPERTY_FALSE ); SET_ITEM_PROPERTY( image_button_id, LABEL, Image On); SET_MENU_ITEM_PROPERTY( image_menu.image_activate, CHECKED, PROPERTY_FALSE ); ELSE SET_ITEM_PROPERTY(product_image_id, DISPLAYED, PROPERTY_TRUE ); SET_ITEM_PROPERTY(image_description_id, DISPLAYED, PROPERTY_TRUE ); SET_ITEM_PROPERTY(image_button_id, LABEL, Image Off); SET_MENU_ITEM_PROPERTY(image_menu.image_activate, CHECKED, PROPERTY_TRUE ); END IF;

    Menu Label Menu Item Type Command Type

    Image Activate Check PL/SQL

  • A-10 Developer/2000: Build Forms II......................................................................................................................................................

    ......................................................................................................................................................

    Appendix A: Practice Solutions

    END;

    d Save and compile the menu module.e Run and test the ORDERS form.

    2 Synchronize the menu module with the form.a Write startup code for the M_SUMMIT menu module that

    synchronizes the Image Activate menu item with the Image button. You can import the pr3_2a.txt file.

    Use the Startup Code menu module property to invoke the PL/SQL Editor.IF GET_ITEM_PROPERTY(CONTROL.IMAGE_BUTTON, LABEL) =Image OffTHEN SET_MENU_ITEM_PROPERTY(IMAGE_MENU.IMAGE_ACTIVATE, CHECKED, PROPERTY_TRUE );END IF;

    b Save and compile your module.3 The menu items Sort By and Image are not relevant to the

    CUSTOMERS form and therefore should have no effect.a Attach the menu module to the CUSTOMERS form.

    Open the CUSTOMERS form and set the Menu Module property to M_SUMMIT for the form module.

    b Modify the startup code of the M_SUMMIT menu module to disable these options when the CUSTOMERS form is opened. You can replace the exisiting code with the code from the pr3_3b.txt file. You may need to change the code to conform to the exact names you gave to the Main Menu and its menu items.Remove the existing code and replace with the following code.Use the SYSTEM.CURRENT_FORM variable to get the name of the current form, and use the SET_MENU_ITEM_PROPERTY built-in procedure to disable these options.

    IF :SYSTEM.CURRENT_FORM = 'CUSTOMERS'THEN

    SET_MENU_ITEM_PROPERTY('MAIN_MENU.SORT_BY', ENABLED, PROPERTY_FALSE);

    SET_MENU_ITEM_PROPERTY('MAIN_MENU.IMAGE', ENABLED, PROPERTY_FALSE);ELSIF GET_ITEM_PROPERTY('CONTROL.IMAGE_BUTTON', LABEL) ='Image Off'

  • Developer/2000: Build Forms II A-11......................................................................................................................................................

    ......................................................................................................................................................

    Practice 3 Solutions

    THEN SET_MENU_ITEM_PROPERTY(IMAGE_MENU.IMAGE_ACTIVATE, CHECKED, PROPERTY_TRUE );END IF;

    c Save and compile the module.d Run the CUSTOMERS form and test your application.Execute a

    Query and click the Orders button to move to the ORDERS form. Note that the Sort By and Image menu items are disabled when the CUSTOMERS form is current, and that they are enabled when the ORDERS form is current.

  • A-12 Developer/2000: Build Forms II......................................................................................................................................................

    ......................................................................................................................................................

    Appendix A: Practice Solutions

    Practice 4 Solutions1 Create and modify a key trigger.

    a Open the ORDERS form module and replace the M_SUMMIT menu module with the DEFAULT&SMARTBAR menu.

    b Run the form and make sure that you understand the default behavior of [Duplicate Record], by invoking it once while the cursor is on a queried record in the S_ORD block and again when the cursor is on a new record.

    c Redefine [Duplicate Record] so that a new record is created before the record duplication occurs. Redefine [Duplicate Record] at the form level.

    Key-Duprec at Form LevelCREATE_RECORD;DUPLICATE_RECORD;

    d In the S_ORD block, redefine [Duplicate Record] in such a way that the Id item is emptied after duplication. This code should be executed in addition to and after the form level code.

    Key-Duprec on the S_ORD Block:s_ord.id := NULL;

    Set the Execution Hierarchy property for this trigger to After.e In the S_ITEM block, redefine [Duplicate Record] in such a way that

    the item_id, product_id, description, and price items are emptied after duplication. This code should be executed in addition to and after the form level code.

    Key-Duprec on the S_ITEM Block:s_item.item_id := NULL;:s_item.product_id := NULL;:s_item.description := NULL;:s_item.price := NULL;

    Set the Execution Hierarchy property for this trigger to After.f Save, generate, and test the ORDERS form.

    If you have time...

  • Developer/2000: Build Forms II A-13......................................................................................................................................................

    ......................................................................................................................................................

    Practice 4 Solutions

    2 Disable function keys.a Make sure that only the function keys [Duplicate Record],

    [Execute Query], [Enter Query], [Create Record], [Clear Block], [Up], and [Down] can be used for the S_ORD master block. All function keys should be available for the S_ITEM detail block.

    Key-Exeqry on the S_ORD BlockEXECUTE_QUERY;

    Key-Entqry on the S_ORD BlockENTER_QUERY;

    Key-CreRec on the S_ORD BlockCREATE_RECORD;

    Key-ClrBlk on the S_ORD BlockCLEAR_BLOCK;

    Key-Up on the S_ORD BlockUP;

    Key-Down on the S_ORD BlockDOWN;

    Key-Others on the S_ORD BlockMESSAGE(Function Not Allowed);

    b Test whether you can exit from the form by selecting the [Exit] key in the master block.You cannot exit the form by selecting the [Exit] key in the master block.

  • A-14 Developer/2000: Build Forms II......................................................................................................................................................

    ......................................................................................................................................................

    Appendix A: Practice Solutions

    c Add a form-level Key-Exit trigger to perform the exit functionality of the CONTROL.EXIT_BUTTON item.

    Key-Exit at Form LevelSET_ALERT_PROPERTY(question_alert, ALERT_MESSAGE_TEXT, Do you really want to leave the form?);IF SHOW_ALERT(question_alert) = ALERT_BUTTON1THEN EXIT_FORM ;END IF;

    d Test again whether you can exit from the form by selecting [Exit] in the master block. Explain this behavior.If there is no key trigger defined for a function key at the same level as Key-Others, Forms searches at a higher level for such a key trigger.

    e Modify the When-Button-Pressed trigger of the CONTROL.EXIT_BUTTON item to activate the same functionality when you select the [Exit] function key. Remove the existing code.

    When-Button-Pressed on the CONTROL.EXIT_BUTTON ItemRemove the existing code and replace with the following code.

    DO_KEY(exit_form);

  • Developer/2000: Build Forms II A-15......................................................................................................................................................

    ......................................................................................................................................................

    Practice 4 Solutions

    3 Create and modify a key trigger.a Create an alert called DELETE_ALERT.b For the S_ORD and S_ITEM blocks, redefine [Delete Record] so

    that the alert is displayed when a record is deleted. Modify the message displayed, depending on the block where the cursor is.

    Key-Delrec on the S_ORD BlockSET_ALERT_PROPERTY(DELETE_ALERT, ALERT_MESSAGE_TEXT, Do you want to delete this order?);IF SHOW_ALERT(DELETE_ALERT) = ALERT_BUTTON1THEN DELETE_RECORD;END IF;

    Key-Delrec on the S_ITEM BlockSET_ALERT_PROPERTY(DELETE_ALERT, ALERT_MESSAGE_TEXT, Do you want to delete this line item?);IF SHOW_ALERT(DELETE_ALERT) = ALERT_BUTTON1THEN DELETE_RECORD;END IF;

    c Specify new text to be displayed in the run-time Show Keys help window.In the Key-Delrec on the S_ORD block, set the Keyboard Help Text trigger property to Remove Order and set the Display in Keyboard Help property to Yes. In the Key-Delrec on the S_ITEM block, set the Keyboard Help Text trigger property to Remove Line Item and set the Display in Keyboard Help property to Yes.

  • A-16 Developer/2000: Build Forms II......................................................................................................................................................

    ......................................................................................................................................................

    Appendix A: Practice Solutions

    Practice 5 SolutionsIn this practice, you provide additional functionality in your forms by defining mouse-event triggers.1 In the CUSTOMERS form, define a mouse-event trigger on

    S_CUSTOMER.COMMENTS that invokes the items editor when the user double-clicks the item.

    WHEN-MOUSE-DOUBLECLICK on s_customer.commentsEDIT_TEXTITEM;

    2 In the ORDERS form convert the CONTROL.SHOW_HELP_BUTTON button into a display item capable of displaying a single large character. Change the item type property and choose a font that allows large character sizes (such as Times New Roman). Set the font size to 24. Set Bevel to none. Adjust the item size so that one character is visible inside it. Since only the first character of the item name is visible in the Layout Editor, this item appears as S. The items background color should match the toolbar, and its text color should be green. There is no formal solution.

    3 In the ORDERS form, define a When-Mouse-Enter trigger at form level that assigns a value of ? to the display item CONTROL.SHOW_HELP_BUTTON. This should occur only when the mouse is in the CV_ORDER canvas.

    WHEN-MOUSE-ENTER at Form LevelIF :SYSTEM.MOUSE_CANVAS = CV_ORDERTHEN :control.show_help_button := ?;END IF;

  • Developer/2000: Build Forms II A-17......................................................................................................................................................

    ......................................................................................................................................................

    Practice 5 Solutions

    4 Create a When-Mouse-Enter trigger on CONTROL.SHOW_HELP_BUTTON that uses the SHOW_VIEW built-in to display the CV_HELP. Remove the When-Button-Pressed trigger.

    WHEN-MOUSE-ENTER trigger on control.show_help_buttonSHOW_VIEW(cv_help);

    5 Create a When-Mouse-Leave trigger on CONTROL.SHOW_HELP_BUTTON that hides the CV_HELP. Use the HIDE_VIEW built-in to achieve this. Delete the CONTROL.HIDE_HELP_BUTTON button.

    WHEN-MOUSE-LEAVE trigger on control.show_help_buttonHIDE_VIEW(cv_help);

    6 Save, compile, and run the ORDERS form to test. The stacked canvas, CV_HELP is displayed only if the current item is not obscured. Ensure, at least, that the first entered item in the form is CV_HELP will not obscure.You might decide to advertise Help only while the cursor is in certain items, or move the stacked canvas to a position that does not overlay enterable items.The CV_HELP canvas, of course, could also be shown in its own window, if appropriate.

    If you have time...7 Modify the When-Mouse-Enter and When-Mouse-Leave triggers to

    display the Cv_Help canvas, even if the current item is obscured. You can replace the existing code with the code from the pr5_7_1.txt and pr5_7_2.txt files.

    WHEN-MOUSE-ENTER trigger on control.show_help_button:GLOBAL.save_item_name := :SYSTEM.CURSOR_ITEM;GO_ITEM(s_ord.id);SHOW_VIEW(cv_help);

    WHEN-MOUSE-LEAVE trigger on control.show_help_buttonHIDE_VIEW(cv_help);GO_ITEM(:GLOBAL.save_item_name);

  • A-18 Developer/2000: Build Forms II......................................................................................................................................................

    ......................................................................................................................................................

    Appendix A: Practice Solutions

    Practice 6 Solutions1 Manipulate a multiple-window form.

    a Open the ORDERS form module.b Make sure that when a user closes the orders window by way of the

    system-menu box, the form is exited. Also make sure that when a user closes the inventory window by way of the system-menu box, the cursor navigates to the orders window. If cursor navigation succeeds, the inventory window should closed. Create a When-Window-Closed trigger. You can import the pr6_1b.txt file.

    When-Window-Closed Trigger at Form LevelIF :SYSTEM.EVENT_WINDOW = WIN_ORDERTHEN DO_KEY(exit_form);ELSIF :SYSTEM.EVENT_WINDOW = WIN_INVENTORY THEN GO_BLOCK(s_ord);END IF;

    c Save, compile, and test the form.There is no formal solution.

    d Make sure that a user cannot make any window larger than it was at the startup of the form. You should save the size of the windows at the startup of the form, and create a procedure called CHECK_WINDOW_SIZE that resets the size of the current window if the new width and height are larger than the initial one. Create a When-New-Form-Instance trigger. You can replace the existing code with the code from the pr6_1d1.txt file. Next, create the procedure CHECK_WINDOW_SIZE. You can import the code from the pr6_1d2.txt file. Create a When-Window-Resized trigger that calls the procedure.The following solution assumes that the window sizes at form startup are stored in global variables with names of the general form:GLOBAL.WIDTH_ andGLOBAL.HEIGHT_

  • Developer/2000: Build Forms II A-19......................................................................................................................................................

    ......................................................................................................................................................

    Practice 6 Solutions

    Note: In multiple-form applications, it is better to use form parameters than global variables, because form parameters are not visible to other forms.

    When-New-Form-Instance Trigger at Form LevelEXECUTE_QUERY;:GLOBAL.width_win_order := GET_WINDOW_PROPERTY(win_order,WIDTH);:GLOBAL.height_win_order := GET_WINDOW_PROPERTY(win_order, HEIGHT);:GLOBAL.width_win_inventory := GET_WINDOW_PROPERTY(win_inventory, WIDTH);:GLOBAL.height_win_inventory := GET_WINDOW_PROPERTY(win_inventory, HEIGHT);

    PROCEDURE check_window_size( p_window IN VARCHAR2 )IS

    v_window_max_widthNUMBER;v_window_max_heightNUMBER;

    BEGINv_window_max_width := NAME_IN(GLOBAL.width_ || p_window );v_window_max_height := NAME_IN(GLOBAL.height_ || p_window );IF v_window_max_width < TO_NUMBER(

    GET_WINDOW_PROPERTY(p_window, WIDTH) )THEN

    SET_WINDOW_PROPERTY(p_window, WIDTH, v_window_max_width );END IF;IF v_window_max_height < TO_NUMBER(

    GET_WINDOW_PROPERTY(p_window, HEIGHT) )THEN

    SET_WINDOW_PROPERTY(p_window, HEIGHT, v_window_max_height );END IF;

    END check_window_size;

    When-Window-Resized Trigger at Form Levelcheck_window_size( :SYSTEM.EVENT_WINDOW );

  • A-20 Developer/2000: Build Forms II......................................................................................................................................................

    ......................................................................................................................................................

    Appendix A: Practice Solutions

    2 Manipulate the MDI application window.a Open the CUSTOMERS form module.b At the startup of the form, maximize the MDI application window,

    and display an appropriate title. You can import the pr6_2b.txt file.

    When-New-Form-Instance Trigger at Form LevelSET_WINDOW_PROPERTY( forms_mdi_window, WINDOW_STATE, MAXIMIZE );SET_WINDOW_PROPERTY( forms_mdi_window, TITLE, Summit Sporting Goods Application);

    If you have time...3 Open the EMPLOYEES form, and use the CONTROL.HELP_TAB text

    item to display a hint or description for the current tab page. a Create a When-Tab-Page-Changed trigger to populate this item with

    an appropriate message for each page. You can import the pr6_3a.txt file.

    When-Tab-Page-Changed Trigger at Form Level:control.help_tab := Displays || Initcap(:SYSTEM.TAB_NEW_PAGE) || information about ------------------> ;b Test and verify your module.c Modify the When-Tab-Page-Changed trigger to change the label on

    the Comment tab page. When Comment is the topmost page, change its label to Employee XX, where XX is the employees ID number (emp.id). When any other tab page is topmost, change the label back to Comment. You can import the pr6_3c.txt file.

    When-Tab-Page-Changed Trigger at Form Level:control.help_tab := Displays || Initcap(:SYSTEM.TAB_NEW_PAGE) || information about ------------------> ;

    IF :SYSTEM.TAB_NEW_PAGE = COMMENT THEN SET_TAB_PAGE_PROPERTY(CANVAS2.COMMENT, LABEL, Employee || :EMP.ID);ELSE SET_TAB_PAGE_PROPERTY(CANVAS2.COMMENT, LABEL, Comment);END IF;

  • Developer/2000: Build Forms II A-21......................................................................................................................................................

    ......................................................................................................................................................

    Practice 7 Solutions

    Practice 7 Solutions 1 Base the EMP block on a subquery.

    a Open the EMPLOYEES form module.b Set the Query Data Source Type EMP block property to From Clause

    Query.In the EMP block Property Palette, under the Database node, change Query Data Source Type to From Clause Query.

    c In the Query Data Source Name property enter the SELECT statement. Your query should return all the columns from the S_EMP table joined with the columns from the S_DEPT table. Remember to enclose your select SELECT statement in parentheses. You can copy and paste the content of the pr7_1c.txt file.

    The SELECT statement is:(SELECT e.ID,

    USERID,LAST_NAME,FIRST_NAME,START_DATE,TITLE,

    MANAGER_ID,DEPT_ID,

    SALARY,COMMISSION_PCT,COMMENTS,d.ID NUM,REGION_ID,NAME

    FROM s_emp e, s_dept dWHERE e.dept_id = d.id)

    d When a blocks Query Data Source Type is Table, the ROWID of each row is implicitly queried when the row is retrieved from the database. This ROWID value is used in the WHERE clause of any subsequent UPDATE, DELETE, or SELECT FOR UPDATE statements issued by Oracle Forms.When a blocks Query Data Source Type is From Clause Query, the ROWID value is not implicitly retrieved. Therefore, the ROWID

  • A-22 Developer/2000: Build Forms II......................................................................................................................................................

    ......................................................................................................................................................

    Appendix A: Practice Solutions

    value cannot be used in subsequent statements. Instead, Oracle Forms constructs the WHERE clause using the primary key values of each row.Configure the EMP block so that Oracle Forms will use the primary key values when constructing the WHERE clause. Set the KeyMode property for the EMP block to Updatable. Set the Enforce Primary Key property for the EMP block to Yes. Set the Primary Key property for the Id item to Yes.

    e Save, run, and test your module.2 Enable DML on the EMP block without using transactional triggers.

    a Set the block DML Target Name.In the EMP block Property Palette, under the Advanced Database node, change DML Data Target Name to S_EMP.

    b Prevent Oracle Forms from attempting to update the columns from the S_DEPT table. On the Property Palette for the item, set the Query Only property to Yes, and the Update Allowed and Insert Allowed properties to No for the S_DEPT items (NUM, NAME, REGION_ID).There is no formal solution.

    c Remove the appropriate transactional triggers.Remove the On-Insert, On-Update, On-Delete, and On-Lock triggers.

    d Save, run, and test your module.If you have time...3 Create a server-side package containing a procedure to return a REF

    cursor.

    Using the code in the pr7_3a.sql file in your labs directory, create the Orders package body and package specification.

    Use SQL*Plus to run the file, or use the Stored Procedure editor in Forms and copy and paste the code from the file.

    4 Modify the Ord_Sum block in the ord_sum.fmb module to base it on the stored procedure.a Open the ord_sum.fmb module. Change the Query Data Source

    Type of the Ord_Sum block to Procedure. Change the DML Data Target Type to None (this block does not allow any inserts, updates, or deletes).

  • Developer/2000: Build Forms II A-23......................................................................................................................................................

    ......................................................................................................................................................

    Practice 7 Solutions

    In the Ord_Sum block Property Palette, under the Database node, change Query Data Source Type to Procedure.Under the Advanced Database node, change DML Data Target Type to None.

    b Set the Query Data Source Name to the name of the stored procedure in the package.Under the Database node, change Query Source Name to ORDERS_PKG.QUERY_PROC. You can find the procedure name by double-clicking the package body name under the Stored Program Units node in the Object Navigator.

    c Specify the Query Data Source Columns to match the items in the Ord_Sum block.

    The column names and types are:ID, NumberNAME, Varchar2(255)TOTAL, Number

    There is no formal solution.d Specify the procedure arguments. The first argument is the REF

    cursor that will be used by Forms to populate the block. The second argument is used to pass the value of the list box (:Choose.View_Type) to the procedure to determine which SELECT statement is used. These arguments should match the arguments to the package procedure.

    The arguments are:

    e Add a trigger on the View_Type item so that the data in the Ord_Sum block is updated when the list box value changes.Hint: You need to execute a query in the Ord_Sum block.

    Add a When-List-Changed trigger to Choose.View_Type as follows:\GO_BLOCK(ord_sum);EXECUTE_QUERY;

    Alternative Method: In the Choose.View_Type Property Palette, change Mouse Navigate to No. Now the cursor remains in the Ord_Sum block and there is no need to code the Go_Block statement.

    Argument Type Type Name Mode Value

    Resultset RefCursor (No Value) In Out (No Value)P_View Varchar2 (No Value) In :Choose.View_Type

  • A-24 Developer/2000: Build Forms II......................................................................................................................................................

    ......................................................................................................................................................

    Appendix A: Practice Solutions

    5 Save and run your form. Observe the behavior of the record count in the console and the scroll bar as you scroll through the records. What do you deduce from this behavior?The record count increments as Forms fetches more records, and the scroll bar button changes size as more records are fetched. From this we can deduce that a block based on a REF Cursor stored procedure benefits from array fetches, just like a block based directly on a table.

  • Developer/2000: Build Forms II A-25......................................................................................................................................................

    ......................................................................................................................................................

    Practice 8 Solutions

    Practice 8 Solutions1 Create a block based on a relational table.

    a Create a new form called OO_DEPT.Select Forms in the Object Navigator and click the Create button. Select the newly created form name and change it to OO_DEPT.

    b Create a block by using the Data Block Wizard. Base the block on the object table OO_DEPT_TABLE, and include all the columns. Do not enforce data integrity.Select Data Blocks in the Object Navigator and click the Create button. Click the OK button to use the Data Block Wizard. Click the Next button to base the new block on a table. Click the Browse button to view a list of tables. (If you are not currently connected to the database, you are asked to supply connect information.) Select OO_DEPT_TABLE and click the OK button. Click the >> button and Next button to select all the available columns.

    c Finish following the Data Block Wizard and invoke the Layout Wizard. Select all available items for display, and use a tabular layout with three displayed records and a scroll bar. Do not enter a frame title.Click the Finish button to create the block and to invoke the Layout Wizard. Click the Next button to use a new content canvas. Click the >> button and the Next button to select all available items for display. Click the Next button to accept the default prompts. Select the Tabular option button and click the Next button to specify a tabular layout. Change the Records Displayed value to 3, and select the Display Scrollbar check box. Click the Next button, then the Finish button.

    d Test and save the form.There is no formal solution.

    2 Create a block based on a relational table with an object column.a Create a form called OBJ_COL.

    Select Forms in the Object Navigator and click the Create button. Select the newly created form name and change it to OBJ_COL.

  • A-26 Developer/2000: Build Forms II......................................................................................................................................................

    ......................................................................................................................................................

    Appendix A: Practice Solutions

    b Create a block by using the Data Block Wizard. Base the block on the relational table REL_EMP_TABLE_OBJCOL. Select the columns ID, FIRST_NAME, and LAST_NAME. Expand the object column DEPT_ID and select the attributes ID and NAME. Note the name that is given to the new item. Do not enforce data integrity.Select Data Blocks in the Object Navigator and click the Create button. Click the OK button to use the Data Block Wizard. Click the Next button to base the new block on a table. Click the Browse button to view a list of tables. Select REL_EMP_TABLE_OBJCOL and click the OK button. Select the ID column and click the > button. Repeat this process for the FIRST_NAME and LAST_NAME columns. Expand the DEPT_ID object column to display the objects attributes. Select the ID attribute and click the > button. Repeat the process for the NAME attribute. Click the Next button to continue.

    c Finish following the Data Block Wizard and invoke the Layout Wizard. Select all available items for display. Change the prompt for item DEPT_ID to Department ID and DEPT_ID_NAME to Department Name. Use a form layout. Do not enter a frame title. Finish following the wizard.Click the Finish button to create the block and to invoke the Layout Wizard. Click the Next button to use a new content canvas. Click the >> button and the Next button to select all available items for display. Select the prompt for the DEPT_ID_ID item and change it. Repeat the process for the DEPT_ID_NAME item. Click the Next button to continue. Click the Next button to specify a form layout. Do not enter a Frame Title. Click the next button to accept the default records displayed. Click the Finish button.

    d Examine the properties for the item dept_id_name. Pay particular attention to the database properties. Later, you will compare and contrast these properties with the properties set for a REF column.There is no formal solution.

    e Test and save the form.There is no formal solution.

    3 Create a block based on a relational table with an REF column and an LOV to populate the REF column.

  • Developer/2000: Build Forms II A-27......................................................................................................................................................

    ......................................................................................................................................................

    Practice 8 Solutions

    a Create a form called REF_COL.Select Forms in the Object Navigator and click the Create button. Select the newly created form name and change it to REF_COL.

    b Create a block by using the Data Block Wizard. Base the block on the relational table REL_EMP_TABLE_REFCOL. Select the columns ID, FIRST_NAME and LAST_NAME. Do not enforce data integrity.Select Data Blocks in the Object Navigator and press the Create button. Press the OK button to use the Data Block Wizard. Press the Next button to base the new block on a table. Press the Browse button to view a list of tables. Select REL_EMP_TABLE_REFCOL and press the OK button. Select the id column and press the > button. Repeat that process for the first name and last name columns.

    c Note that there are two items called DEPT_ID. The first is expandable and has the term LOOKUP in parenthesis after the name. The second represents the REF column value itself. Expand the first DEPT_ID item and select the attributes ID and NAME. (Do not select the second DEPT_ID item. The REF item is included automatically when the LOV is created.)Expand the dept_id object column to display the object attributes. Select the id attribute and click the > button. Repeat the process for the name attribute. Click the Next button to continue.

    d The Data Block Wizard offers to create an LOV for the REF item dept_id. Select the check box, and select OO_DEPT_TABLE as the source for the LOV. Select the dept_id check box. Press the ... button, select the OO_DEPT_TABLE table and click the OK button. Click the Next button to continue.

    e Finish following the Data Block Wizard and invoke the Layout Wizard. Select all available items for display. Do not enter a frame title. (Note that the REF item DEPT_ID is included in the list of items in the Object Navigator but is not included in the list of available items in the Layout Wizard. REF item values are normally not displayed, so by default the REF item is assigned to the Null canvas.)

  • A-28 Developer/2000: Build Forms II......................................................................................................................................................

    ......................................................................................................................................................

    Appendix A: Practice Solutions

    Click the Finish button to create the block and to invoke the Layout Wizard. Click the Next button to use a new content canvas. Click the >> button and the Next button to select all available items for display. Change the prompt for item dept_id_id to Department Id and dept_id_name to Department Name. Use a form layout. Do not enter a Frame Title. Finish following the wizard.

    f Examine the database properties for the item DEPT_ID_NAME. Pay particular attention to the database properties. Notice that the Query Only property is set to Yes.There is no formal solution.

    g Select the item DEPT_ID from the Object Navigator, and examine the Canvas property. Also, notice that an LOV and associated record group now exist.There is no formal solution.

    h Test and save the form, including the LOV.There is no formal solution.

  • Developer/2000: Build Forms II A-29......................................................................................................................................................

    ......................................................................................................................................................

    Practice 9 Solutions

    Practice 9 Solutions1 Open the ORDERS form and examine the properties of the relation

    called S_ORD_S_ITEM. a Note the deletion and coordination property values.b Run the ORDERS form and test the way deletes are handled.

    2 Implement a query coordination-type toggle.a Add two check boxes to the control block with the following

    properties:

    b Use the Layout Editor to position the checkboxes appropriately in the Toolbar canvas.

    Property Check Box 1 Check Box 2

    Name IMMEDIATE AUTO_QUERYEnabled Yes No

    Label Immediate Auto QueryValue When Checked Y Y

    Value When Unchecked N N

    Check Box Mapping of Other Value

    CHECKED UNCHECKED

    Keyboard Navigable No No

    Mouse Navigate No No

    Data Type CHAR CHAR

    Initial Value Y Y

    DataBase Item No No

    Canvas TOOLBAR TOOLBAR

  • A-30 Developer/2000: Build Forms II......................................................................................................................................................

    ......................................................................................................................................................

    Appendix A: Practice Solutions

    c Make sure that the first check box enables a user to toggle between immediate coordination and deferred coordination. You can import the pr9_2c.txt file.

    When-Checkbox-Changed on CONTROL.IMMEDIATEIF GET_RELATION_PROPERTY( s_ord_s_item, DEFERRED_COORDINATION ) = FALSETHEN

    SET_RELATION_PROPERTY(s_ord_s_item, DEFERRED_COORDINATION, PROPERTY_TRUE);

    SET_ITEM_PROPERTY(control.auto_query, ENABLED, PROPERTY_TRUE );ELSE

    SET_RELATION_PROPERTY(s_ord_s_item, DEFERRED_COORDINATION, PROPERTY_FALSE);

    SET_ITEM_PROPERTY(control.auto_query, ENABLED, PROPERTY_FALSE );END IF;

    d Make sure that the second check box enables a user to toggle between automatic query and no automatic query for the detail block. This check box should be disabled if the other check box indicates immediate coordination. You can import the pr9_2d.txt file.

    When-Checkbox-Changed on CONTROL.AUTO_QUERYIF GET_RELATION_PROPERTY(s_ord_s_item, AUTOQUERY ) = FALSETHEN

    SET_RELATION_PROPERTY(s_ord_s_item, AUTOQUERY, PROPERTY_TRUE );ELSE

    SET_RELATION_PROPERTY(s_ord_s_item, AUTOQUERY, PROPERTY_FALSE);END IF;

    e Test and save the form.There is no formal solution.

    If you have time...3 Add a detail block based on a REF relation to the OO_DEPT table.

    a Open the OO_DEPT form in the Object Navigator.There is no formal solution.

  • Developer/2000: Build Forms II A-31......................................................................................................................................................

    ......................................................................................................................................................

    Practice 9 Solutions

    b Create a new block by using the Data Block Wizard. Base the block on the table REL_EMP_TABLE_REFCOL, and include the id, first_name, last_name, and dept_id REF columns. Do not enforce data integrity, and do not create an LOV.Select Data Blocks in the Object Navigator and click the Create button. Click the OK button to use the Data Block Wizard. Click the Next button to base the new block on a table. Click the Browse button to view a list of tables. (If you are not currently connected to the database, you are asked to supply connect information.) Select OO_EMP_TABLE_REFCOL and click the OK button. Select the id column and click the > button. Repeat the process for the first_name, last_name, and dept_id REF columns. (In the display, the entry DEPT_ID without the word Lookup after it represents the dept_id REF column. Click the Next button to continue.

    c Create a relationship between the two blocks using the REF value.Click the Create Relationship button. Select the block OO_DEPT_TABLE and click the OK button. Click the Next button to continue.

    d Finish following the Data Block Wizard and invoke the Layout Wizard. Select all available items for display, and use a tabular layout with three displayed records and a scroll bar. Do not specify a frame title.Click the Finish button to create the block and to invoke the Layout Wizard. Click the Next button to use the existing content canvas. Click the >> button and the Next button to select all available items for display. Click the Next button to accept the default prompts. Select the Tabular option button and click the Next button to specify a tabular layout. Change the Records Displayed value to 3, and select the Display Scrollbar check box. Click the Next button, then the Finish button.

    e Test and save the form.There is no formal solution.

    4 Synchronize the check boxes at form startup.a Open the ORDERS form module.b Create a procedure called INIT_RELATION_CHECK_BOXES.

    This procedure synchronizes the IMMEDIATE and AUTO_QUERY

  • A-32 Developer/2000: Build Forms II......................................................................................................................................................

    ......................................................................................................................................................

    Appendix A: Practice Solutions

    check boxes with the current default value. You can import the pr9_4b.txt file.

    PROCEDURE init_relation_check_boxes ISBEGIN IF GET_RELATION_PROPERTY(s_ord_s_item', DEFERRED_COORDINATION) = 'FALSE' THEN :control.immediate := Y; SET_ITEM_PROPERTY(control.auto_query, ENABLED, PROPERTY_FALSE); ELSE :control.immediate := N; SET_ITEM_PROPERTY(control.auto_query, ENABLED, PROPERTY_TRUE ); END IF; IF GET_RELATION_PROPERTY(s_ord_s_item, AUTOQUERY) = TRUE THEN :control.auto_query := Y; ELSE :control.auto_query := N; END IF;END;

    c Call this procedure from the When-New-Form-Instance trigger.init_relation_check_boxes;EXECUTE_QUERY;:GLOBAL.width_win_order := GET_WINDOW_PROPERTY(win_order, WIDTH);:GLOBAL.height_win_order := GET_WINDOW_PROPERTY(win_order,HEIGHT);:GLOBAL.width_win_inventory := GET_WINDOW_PROPERTY(win_inventory, WIDTH);:GLOBAL.height_win_inventory := GET_WINDOW_PROPERTY(win_inventory, HEIGHT);

    5 Implement foreign-key delete rules.a Open the CUSTOMERS form module. Change the Menu Module

    property to DEFAULT&SMARTBAR.b Create a procedure called CHECK_DEL_CUS. This procedure

    displays an error message as soon as a user tries to delete a customer for which matching orders exist. You can import the pr9_5b.txt file.

    PROCEDURE check_del_cus ( p_cus_id IN NUMBER )

  • Developer/2000: Build Forms II A-33......................................................................................................................................................

    ......................................................................................................................................................

    Practice 9 Solutions

    ISCURSOR c_ord IS

    SELECT XFROM s_ordWHERE customer_id = p_cus_id;

    v_dummy VARCHAR2(1);ord_exists EXCEPTION;

    BEGINOPEN c_ord;FETCH c_ord INTO v_dummy;IF c_ord%FOUND THEN

    CLOSE c_ord;RAISE ord_exists;

    ELSECLOSE c_ord;

    END IF;EXCEPTION

    WHEN ord_exists THEN MESSAGE(Cannot delete customer while matching orders exist.);

    RAISE FORM_TRIGGER_FAILURE;END check_del_cus;c Call the procedure when a user selects the delete function key.

    Key-Delrec Trigger on S_CUSTOMER Blockcheck_del_cus(:s_customer.id);DELETE_RECORD;

    d Save, compile, and run the module.

  • A-34 Developer/2000: Build Forms II......................................................................................................................................................

    ......................................................................................................................................................

    Appendix A: Practice Solutions

    Practice 10 Solutions1 Produce a multiple form application by linking the CUSTOMERS and

    the EMPLOYEES forms.a In the control block of the CUSTOMERS form, create a button

    called EMPLOYEE_BUTTON. Place it on the CV_CUST canvas, below the Orders button.

    b Define a trigger for CONTROL.EMPLOYEE_BUTTON that calls the EMPLOYEES form with the current sales representative ID.

    - Change the Mouse Navigate property of CONTROL.EMPLOYEE_BUTTON to No.

    - Create a parameter list called SALES.- Add the SALES_ID parameter to the parameter list. The type of this

    parameter is TEXT_PARAMETER, and it is initialized with the value of the SALES_REP_ID item.

    - Invoke the EMPLOYEES form by using the CALL_FORM built-in.You can import the pr10_1b.txt file.

    When-Button-Pressed on the CONTROL.EMPLOYEE_BUTTON ItemDECLARE p_list_id PARAMLIST;BEGIN IF NOT ID_NULL( GET_PARAMETER_LIST( sales ) ) THEN DESTROY_PARAMETER_LIST(sales); END IF;

    p_list_id := CREATE_PARAMETER_LIST(sales); ADD_PARAMETER( p_list_id, sales_id, TEXT_PARAMETER, TO_CHAR( :s_customer.sales_rep_id )); CALL_FORM(employees, NO_HIDE, DO_REPLACE, NO_QUERY_ONLY, p_list_id );END ;

    c Open the EMPLOYEES form module.d In the Object Navigator, create a parameter called SALES_ID.e Add a trigger to ensure that queries on the employee block are

    restricted by the value of the SALES_ID parameter. Replace the existing code with the code in the pr10_1e.txt file.

    Pre-Query Trigger on the EMP Block

  • Developer/2000: Build Forms II A-35......................................................................................................................................................

    ......................................................................................................................................................

    Practice 10 Solutions

    DEFAULT_VALUE(, GLOBAL.sales_rep_id);IF :GLOBAL.sales_rep_id IS NOT NULL AND :PARAMETER.sales_id IS NULLTHEN

    :emp.num := :GLOBAL.sales_rep_id;ELSE :emp.num := :PARAMETER.sales_id;END IF;

    f Save and compile each form, then run the CUSTOMERS form module. Test the application by exiting the EMPLOYEE form using the menu or the toolbar.

    If you have time...2 Transaction processing for called forms:

    a Make sure that any changes in the EMPLOYEES form that are posted by a user are not rolled back by Forms upon exit.

    Key-Exit Trigger at Form Level: EMPLOYEES FormEXIT_FORM( ASK_COMMIT, NO_ROLLBACK );

    b Make sure that when the CUSTOMERS form calls the EMPLOYEES form, [Commit] performs a post. You can import the pr10_2b.txt file.

    Key-Commit Trigger at Form Level: EMPLOYEES FormIF GET_APPLICATION_PROPERTY( CALLING_FORM ) IS NULL THEN COMMIT_FORM;ELSE POST;END IF;

    c Save and compile each form, then run the CUSTOMERS form module and test your application.

  • A-36 Developer/2000: Build Forms II......................................................................................................................................................

    ......................................................................................................................................................

    Appendix A: Practice Solutions

    Practice 11 Solutions1 Create a dynamic list item. This functionality avoids having to create a

    new item to display the department name.a Open the EMPLOYEES form module.

    There is no formal solution.b Create a design time query record group that contains IDs and names

    of departments. Name your record group DEPT_ID.In the Object Navigator, create a record group named DEPT_ID based on the query below:SELECT name || in region || TO_CHAR(region_id) Name, TO_CHAR(id) IdFROM s_deptORDER BY 1

    There is no formal solution.c Convert the text item DEPT_ID into a list item, Combo Box Style.

    Resize it in the Layout Editor.There is no formal solution.

    d Create an element in the list. Label: Dummy and Value: 0There is no formal solution.

    e Create a procedure called LIST_FROM_DESIGNTIME_GROUP. This procedure accepts the list item name as an argument and populates the list item dynamically at runtime, using the design-time query record group. You can import the pr11_1e.txt file.

    PROCEDURE List_From_DesignTime_Group (p_list_item IN VARCHAR2)IScst_rg_nom CONSTANT VARCHAR2( 30 ) := GET_ITEM_PROPERTY(p_list_item, ITEM_NAME );BEGIN IF POPULATE_GROUP( cst_rg_nom ) = 0 THEN POPULATE_LIST( p_list_item, cst_rg_nom ); END IF;

    COPY( GET_LIST_ELEMENT_VALUE( p_list_item,1 ), p_list_item);END List_From_DesignTime_Group;

  • Developer/2000: Build Forms II A-37......................................................................................................................................................

    ......................................................................................................................................................

    Practice 11 Solutions

    f Call the procedure each time a new record is created. You can import the pr11_1f.txt file.

    When-Create-Record Trigger on the EMP Block,CLEAR_LIST(EMP.DEPT_ID);LIST_FROM_DESIGNTIME_GROUP(EMP.DEPT_ID);g Save, compile, and test the module.

    There is no formal solution.

    If you have time...2 Create a multirecord select list form. This practice shows how to create a

    list of values where the user can select multiple values. This lab uses a global record group.a Exit Form Builder.b Run Form Builder and create a new form based on a template named

    lov_prod_template.fmb.c Examine this new module and save it as lov_product.fmb.

    This new form contains a multi-record block based on the S_PRODUCT table. Only the ID, NAME, and SUGGESTED_WHLSL_PRICE columns are displayed.This form also contains an OK button and a Cancel button without any code.This form contains two visual attributes called DESELECTED and SELECTED.

    d Create a When-Mouse-Click trigger at the PROD_LOV_BLK block level that selects or clears a record when a user presses Control-clicks for a product. Write the code to create a record group if it does not already exist and add columns to the group for each item in the PROD_LOV_BLK block. If the record group exists write the code to retrieve the internal ID for each column in the record group.Write the code to check whether the record selected is already in the record group. If so, loop through each item in the record to keep the visual attribute from being highlighted, and then remove the record from the record group.If the user selects a record that was not already in the group, write the code to add the record to the record group and loop through each

  • A-38 Developer/2000: Build Forms II......................................................................................................................................................

    ......................................................................................................................................................

    Appendix A: Practice Solutions

    item in the block to keep the color highlighted.Use the SELECTED and DESELECTED visual attributes in your code to change the color of a selected or cleared record.You can import the pr11_2d.txt file.

    When-Mouse-Click Trigger on the PROD_LOV_BLK BlockDECLARE rg_id RECORDGROUP := FIND_GROUP(sel_records); recno_id GROUPCOLUMN; prodno_id GROUPCOLUMN; prodname_id GROUPCOLUMN; prodprice_id GROUPCOLUMN; no_rows NUMBER(7); desel VARCHAR2(5) := no; itm VARCHAR2(80); lst VARCHAR2(100);BEGIN--

    IF :SYSTEM.MOUSE_BUTTON_MODIFIERS = Control+ THEN -- If record group does not exist -- create it and add columns to the -- group for each item in the PROD_LOV_BLK IF ID_NULL(rg_id) THEN rg_id := CREATE_GROUP(sel_records, GLOBAL_SCOPE); recno_id := ADD_GROUP_COLUMN(rg_id,recno,NUMBER_COLUMN); prodno_id := ADD_GROUP_COLUMN(rg_id,prodno,NUMBER_COLUMN); prodname_id := ADD_GROUP_COLUMN(rg_id,prodname, CHAR_COLUMN, 80); prodprice_id := ADD_GROUP_COLUMN(rg_id,prodprice, NUMBER_COLUMN);

    -- if the record group does exist -- retrieve the internal id for each -- column in the record group ELSE recno_id := FIND_COLUMN(sel_records.recno); prodno_id := FIND_COLUMN(sel_records.prodno); prodname_id := FIND_COLUMN(sel_records.prodname); prodprice_id := FIND_COLUMN(sel_records.prodprice); END IF;

  • Developer/2000: Build Forms II A-39......................................................................................................................................................

    ......................................................................................................................................................

    Practice 11 Solutions

    -- check to see if record CNTL -- clicked on is already in the record -- group - if so loop thru each item -- in the block to set the visual -- attribute back from being highlighted, -- and then remove record from -- record group no_rows := GET_GROUP_ROW_COUNT(rg_id); FOR i IN 1..no_rows LOOP IF TO_NUMBER(:SYSTEM.MOUSE_RECORD) = GET_GROUP_NUMBER_CELL(recno_id, i) THEN desel := yes; itm := GET_BLOCK_PROPERTY(:SYSTEM.CURSOR_BLOCK, FIRST_ITEM); itm := :SYSTEM.CURSOR_BLOCK || . || itm; LOOP DISPLAY_ITEM(itm, DESELECTED); itm := GET_ITEM_PROPERTY(itm, NEXTITEM); EXIT WHEN itm IS NULL; itm := :SYSTEM.CURSOR_BLOCK || . || itm; END LOOP; DELETE_GROUP_ROW(rg_id, i); EXIT;

    END IF; END LOOP;

    -- if CNTL click on a record that -- was not already in the group -- add the record to the record group -- and loop through each -- item in the block to set the color -- to be highlighted for each. IF desel != 'yes' THEN ADD_GROUP_ROW(rg_id,end_of_group); SET_GROUP_NUMBER_CELL(recno_id, no_rows+1, TO_NUMBER(:SYSTEM.MOUSE_RECORD)); SET_GROUP_NUMBER_CELL(prodno_id, no_rows+1, :prod_lov_blk.id); SET_GROUP_CHAR_CELL(prodname_id, no_rows+1, :prod_lov_blk.name); SET_GROUP_NUMBER_CELL(prodprice_id, no_rows+1, :prod_lov_blk.suggested_whlsl_price); itm := GET_BLOCK_PROPERTY( :SYSTEM.CURSOR_BLOCK , FIRST_ITEM );

  • A-40 Developer/2000: Build Forms II......................................................................................................................................................

    ......................................................................................................................................................

    Appendix A: Practice Solutions

    itm := :SYSTEM.CURSOR_BLOCK || . || itm; LOOP DISPLAY_ITEM(itm, SELECTED); itm := GET_ITEM_PROPERTY(itm, NEXTITEM); EXIT WHEN itm IS NULL; itm := :SYSTEM.CURSOR_BLOCK || . || itm; END LOOP; END IF; END IF;END;

    e Create the code for the OK button. This button enables the user to exit the form.

    DO_KEY(EXIT_FORM);f Create the code for the Cancel button in the PROD_LOV_BLK

    block. Create a When-Button-Pressed trigger that deletes the record group before returning to the ITEM block. You can import the pr11_2f.txt file.

    When-Button-Pressed Trigger at PROD_LOB_BLK.CANCEL_PB ItemIF NOT ID_NULL(FIND_GROUP(sel_records)) THEN DELETE_GROUP(sel_records);END IF;

    DO_KEY(EXIT_FORM);

    g In the ORDERS form, modify the When-Button-Pressed trigger for the CONTROL.PRODUCT_LOV_BUTTON. The new code should check the existing products in the S_ITEM block, so that products already ordered do not show up in the list. The trigger then calls the PROD_LOV_BLK form, passing the list of existing products using a GLOBAL variable. You can import the pr11_2g.txt file.

    :GLOBAL.where_cls := id NOT IN (;GO_BLOCK(item);FIRST_RECORD;IF:SYSTEM.RECORD_STATUS != NEW THEN LOOP :GLOBAL.where_cls := :GLOBAL.where_cls || TO_CHAR(:item.product_id);

  • Developer/2000: Build Forms II A-41......................................................................................................................................................

    ......................................................................................................................................................

    Practice 11 Solutions

    NEXT_RECORD; EXIT WHEN :SYSTEM.LAST_RECORD = TRUE; :GLOBAL.where_cls := :GLOBAL.where_cls || ,'; END LOOP; :GLOBAL.where_cls := :GLOBAL.where_cls || , || TO_CHAR(:item.product_id) || ); END IF;CALL_FORM(lov_product, NO_HIDE); h In the LOV_PRODUCT form, create a When-New-Form-Instance

    trigger to retrieve the list of products excluding the products that exist in the S_ITEM block. You should use the global variable created earlier. You can import the pr11_2h.txt file.

    When-New-Form-Instance Trigger at Form LevelDEFAULT_VALUE(, 'GLOBAL.where_cls);SET_BLOCK_PROPERTY(prod_lov_blk, DEFAULT_WHERE, :GLOBAL.where_cls);EXECUTE_QUERY;

    i In the ORDERS form, modify the When-Button-Pressed trigger for the CONTROL.PRODUCT_LOV_BUTTON. After you call the form, the code creates records in the S_ITEM block for each row selected in the record group. The code then deletes the record group.You can import the pr11_2i.txt file. Place the new code after the existing code.

    j Save, run, and test your forms. To select multiple items, select the first item, hold the Control key down, and then select other items.

  • A-42 Developer/2000: Build Forms II......................................................................................................................................................

    ......................................................................................................................................................

    Appendix A: Practice Solutions

    Practice 12 Solutions1 Create a chart object by using the Chart Wizard. This chart should

    display the total orders for each customer.a Open the CUSTOMERS form module.

    There is no formal solution.b Create a new tab page on the TAB_CUSTOMER canvas. Name this

    page CHART and change the label name.There is no formal solution.Open the FormBuilder_II.olb object library. Copy the OBJ_CHART object group into the CUSTOMERS form. This object group contains a block named S_ORD. Only one item from this block is visible: TITLE. This item displays a title for the chart.In the Object Navigator, double-click the icon next to the FORM_BUILDER_II object library node.From the Chart tab, select the OBJ_CHART object group and drag it to the object group node in the CUSTOMERS form.Select Copy.

    c From the Layout Editor, use the Chart tool to drag a chart area onto the chart tab page. Select Use the Chart Wizard from the New Chart Object dialog box. Do not specify a title for the chart.There is no formal solution.

    d Select Column as chart type, Plain as chart subtype.There is no formal solution.

    e Specify the S_ORD block as the data block that contains the data you want to assign to chart columns.There is no formal solution.

    f Select CUSTOMER_NAME to appear on the Category (X) axis, and TOTAL to appear on the Value (Y) axis of the chart.There is no formal solution.

    g Click the Finish button. Save, run, and test your form. To display the chart, click in the Title item on the Chart tab.

    2 Create a report object based on the S_CUSTOMER block. This report displays a customer list using a tabular layout. Display only the ID, NAME, COUNTRY, and REGION_ID fields.a Open the CUSTOMERS form.

  • Developer/2000: Build Forms II A-43......................................................................................................................................................

    ......................................................................................................................................................

    Practice 12 Solutions

    b Create a new report object.- Select the Report Object node in the Object Navigator.- Click the Create icon.- Specify a filename of myreport and a block name.- Click OK.This will invoke the Report Builder. Within the Report Wizard:- Choose the report style Tabular.- Select the ID, NAME, COUNTRY, and CREDIT_RATING fields.- Do not select fields to total.- Change labels and widths for your fields.- Select a template for your report.c Save your report and exit Report Builder.d Set the Execution Mode report object property to runtime and the

    Report Destination Type report object property to screen.Display the Property Palette for the report object.Select Execution Mode and change the value to RUNTIME.Select Report Destination Type and change the value toSCREEN.

    e Create a button named CUST_REP_BUTTON into the control block. Display this button on the CV_CUSTOMER canvas.

    f Create a When-Button-Pressed trigger on the CUST_REP_BUTTON button to run the report.

    DECLARE myvar VARCHAR2(50);BEGIN myvar := RUN_REPORT_OBJECT(my_report);END ;

    g Change the Query All Record property value to Yes for the S_CUSTOMER block.

    h Save, run, and test your form. Query a customer record before calling the report.

  • A-44 Developer/2000: Build Forms II......................................................................................................................................................

    ......................................................................................................................................................

    Appendix A: Practice Solutions

    If you have time...3 Create a new tab page from which the user can run different report

    layouts.a Open the Form_Builder_II.olb object library.

    In the Object Navigator, double-click the icon next to the FORM_BUILDER_II object library node.

    b From the Report tab page, select all the report objects and copy them to the CUSTOMERS form.

    c Change the filename property to each report so that the path is correct for your environment.Do this in the Object Navigator.

    d From the Report tab page, select the REPORT block and copy it to the CUSTOMERS form. Organize this block so it is the last block in sequence.Do this in the Object Navigator.

    e From the Report tab page, select the REPORT tab page object and copy it to the CUSTOMERS form. Organize this tab page so it is the last tab page in sequence.Do this in the Object Navigator.

    f Save, run, and test your form.

  • Developer/2000: Build Forms II A-45......................................................................................................................................................

    ......................................................................................................................................................

    Practice 13 Solutions

    Practice 13 Solutions1 Show About... information at the startup of the form.

    a Open the CUSTOMERS form module.b Add a window and a canvas to the form that are used to display the

    two control items. This window could be considered an About... window and should be a modal dialog window. Set the Hide on Exit property to Yes for this window.Create a window named ABOUT. Set the Window Style property to Dialog. Set the Modal Property to Yes. Set both the X Position and Y Position properties to 100.Create a canvas named ABOUT. Set the Window property to ABOUT.

    c Create manually a new control block, called ABOUT. Create two items in the ABOUT block that are used to display the user name and the current date and time.Create a content canvas named ABOUT. In the layout editor, create two text items named user_name and client date. Create the text items on the ABOUT ca