1 / 47

Chapter 3 Using the Object Navigator, Form Objects, and Detail Data Blocks

Chapter 3 Using the Object Navigator, Form Objects, and Detail Data Blocks. In this chapter you will: Learn the importance of the Object Navigator and how to use it Learn definitions of form objects Be exposed to the types of files used by Forms Builder Create and use detail data blocks

machiko-rin
Download Presentation

Chapter 3 Using the Object Navigator, Form Objects, and Detail Data Blocks

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 3 Using the Object Navigator, Form Objects, and Detail Data Blocks Oracle9i Developer: Developing Web Applications with Forms Builder

  2. In this chapter you will: • Learn the importance of the Object Navigator and how to use it • Learn definitions of form objects • Be exposed to the types of files used by Forms Builder • Create and use detail data blocks • Use control blocks • Create a data block using a FROM clause query as the data source Oracle9i Developer: Developing Web Applications with Forms Builder

  3. Importance of the Object Navigator and its Use • The Object Navigator is the central Form Builder tool. • The Object Navigator can be used to create, delete, and locate form components. • Objects are displayed in a hierarchy. At the top of the hierarchy are the file objects: forms, menus, PL/SQL libraries, object libraries, built-in packages, and database objects. Oracle9i Developer: Developing Web Applications with Forms Builder

  4. Importance of the Object Navigator and its Use • The Object Navigator has a toolbar that can be used to create, delete, expand, and collapse an object. Oracle9i Developer: Developing Web Applications with Forms Builder

  5. Importance of the Object Navigator and its Use • Expanding an object consists of displaying the object’s children objects. • Collapsing an object consists of hiding an object’s children objects. Oracle9i Developer: Developing Web Applications with Forms Builder

  6. Importance of the Object Navigator and its Use • An object that is preceded by a plus sign has child objects that can be viewed upon expansion. • An object that is preceded by a negative sign has all of its child objects displayed and cannot be expanded. • Objects can be expanded and collapsed by clicking the plus or negative symbols. • The Expand All tool can be used to display all children beneath the selected object. Oracle9i Developer: Developing Web Applications with Forms Builder

  7. Importance of the Object Navigator and its Use • The Collapse All tool can be used to hide all children beneath the selected object. • The Object Navigator file object can be returned to its default state by selecting the file object and selecting the Collapse All tool. Oracle9i Developer: Developing Web Applications with Forms Builder

  8. Importance of the Object Navigator and its Use Oracle9i Developer: Developing Web Applications with Forms Builder

  9. Importance of the Object Navigator and its Use • Each object on the Object Navigator has its own distinct icon Oracle9i Developer: Developing Web Applications with Forms Builder

  10. Importance of the Object Navigator and its Use • It is possible to copy and paste objects within the module or between modules. • It is possible to move objects by selecting and dragging them. Oracle9i Developer: Developing Web Applications with Forms Builder

  11. Importance of the Object Navigator and its Use • When an object is moved, the cursor will turn into a Stop sign whenever it is located over an object to which the dragged object cannot be moved. • The Stop sign disappears when it is OK to release the object. Oracle9i Developer: Developing Web Applications with Forms Builder

  12. Importance of the Object Navigator and its Use Oracle9i Developer: Developing Web Applications with Forms Builder

  13. Importance of the Object Navigator and its Use • Multiple items can be selected by holding the Shift key or the Control key. • The Shift key will cause all objects between the selected object and the previously selected object to be selected. Oracle9i Developer: Developing Web Applications with Forms Builder

  14. Importance of the Object Navigator and its Use • The Control key will cause the current object to be selected and added to the set of selected objects. • When an object is moved from one module to another, you will be asked if you want to copy the object or subclass the object. • Subclassing consists of linking the copied object to the original. When the original is modified, the copied object will also be modified when the form is recompiled. Oracle9i Developer: Developing Web Applications with Forms Builder

  15. Importance of the Object Navigator and its Use • The Object Navigator has two views: • The Ownership view is the default and lists all objects and child objects. • The Visual view displays the object in a hierarchy beginning with the window. Underneath the window are the canvases and the items displayed on the canvas. Oracle9i Developer: Developing Web Applications with Forms Builder

  16. Importance of the Object Navigator and its Use • The Object Navigator has a Fast Search tool that can be used to locate objects. Oracle9i Developer: Developing Web Applications with Forms Builder

  17. Definitions of Various Form Objects Oracle9i Developer: Developing Web Applications with Forms Builder

  18. Definitions of Various Form Objects Oracle9i Developer: Developing Web Applications with Forms Builder

  19. Definitions of Various Form Objects Oracle9i Developer: Developing Web Applications with Forms Builder

  20. Types of Files Used by Forms Builder Oracle9i Developer: Developing Web Applications with Forms Builder

  21. Creating and Using Detail Data Blocks • Relational databases are filled with tables based upon regular and weak entities. • The regular entity table contains the unique information about the entity and the weak entity contains repeating information. Oracle9i Developer: Developing Web Applications with Forms Builder

  22. Creating and Using Detail Data Blocks Oracle9i Developer: Developing Web Applications with Forms Builder

  23. Creating and Using Detail Data Blocks • It is a very common form requirement to display a regular entity record such as a student along with the weak entity records such as the courses taken. • Forms Builder allows you to create coordinated blocks called master-detail data blocks that display regular and weak entity records. Oracle9i Developer: Developing Web Applications with Forms Builder

  24. Creating and Using Detail Data Blocks Oracle9i Developer: Developing Web Applications with Forms Builder

  25. Creating and Using Detail Data Blocks • In a master-detail form, the controlling block is called the master block. It contains the regular entity records. • The block that contains the repeating weak entity records is called the detail data block. • Master data blocks are created in the normal manner. • Detail data blocks can be created manually but generally are created using the Data Block Wizard. Oracle9i Developer: Developing Web Applications with Forms Builder

  26. Creating and Using Detail Data Blocks • When a form already has an existing data block, whenever a subsequent data block is created using the Data Block Wizard, an additional page called the Master-detail page will appear. Oracle9i Developer: Developing Web Applications with Forms Builder

  27. Creating and Using Detail Data Blocks Oracle9i Developer: Developing Web Applications with Forms Builder

  28. Creating and Using Detail Data Blocks • The purpose of the Master-detail page is to prompt the developer for the information needed to create the objects and code used to synchronize the records in the master and detail blocks. This information consists of: • Master data block • Related columns (or the join condition) Oracle9i Developer: Developing Web Applications with Forms Builder

  29. Creating and Using Detail Data Blocks • If the table used as a data source in the detail data block has a foreign key constraint that references the data source of another block on the form, the referenced data blocks will be displayed on the page. Oracle9i Developer: Developing Web Applications with Forms Builder

  30. Creating and Using Detail Data Blocks • If foreign keys do not exist, the developer will have to identify the master block and join columns manually. Perform the following: • Uncheck the Auto-join data block checkbox • Press the Create Relationships button • Select the appropriate data block on the called dialog box • Create the join condition by selecting the appropriate item in the Detail Item and Master Item pick lists. Oracle9i Developer: Developing Web Applications with Forms Builder

  31. Creating and Using Detail Data Blocks • Upon completion of the Data Block Wizard, Forms Builder will create the triggers and other objects used to coordinate the records in the master-detail data blocks. • If the detail data block is deleted, Forms Builder will automatically delete the triggers and objects it created. Oracle9i Developer: Developing Web Applications with Forms Builder

  32. Creating and Using Detail Data Blocks Oracle9i Developer: Developing Web Applications with Forms Builder

  33. Creating and Using Detail Data Blocks • One of the Forms Builder objects created is a Relations object. • A Relations object has several properties that affect the behavior of the detail data block. These properties are: • Delete Record Behavior - Controls whether the detail records must be deleted prior to the deletion of the master record. • Automatic Query - Determines whether the operator must manually execute the query. • Deferred - Determines whether the query will be delayed until the operator places the input focus into the detail data block. Oracle9i Developer: Developing Web Applications with Forms Builder

  34. Creating and Using Detail Data Blocks • The Automatic Query property causes the detail data block to be populated automatically whenever the operator changes records on the master data block. • For performance reasons it may be advantageous to temporarily disable the property until the operator locates the target master records. • The Automatic Query property can be enabled/disabled using a coordination type trigger that uses the Set_relation_property. Oracle9i Developer: Developing Web Applications with Forms Builder

  35. Control Blocks and their Use • Data blocks flush their contents each time they are placed into the Enter Query mode. • Data blocks are always placed into the ENTER QUERY mode prior to being placed into the QUERY mode. This is true even if it is not evident. • Forms often need to retain values for use within the form (i.e. security id, user name) • Most forms have one or more blocks not associated with a data source. These blocks are called control blocks. Oracle9i Developer: Developing Web Applications with Forms Builder

  36. Creating a Data Block with a FROM Clause Query as the Data Source • Most databases have tables that provide descriptive information about a value. • 2nd and 3rd Normal forms require that these tables be created. Oracle9i Developer: Developing Web Applications with Forms Builder

  37. Creating a Data Block with a FROM Clause Query as the Data Source • However, a form often requires that the descriptive values be added to the data block. It is far preferable to display a code description rather than a code. • Data blocks based upon a table generally need this descriptive information. Oracle9i Developer: Developing Web Applications with Forms Builder

  38. Creating a Data Block with a FROM Clause Query as the Data Source • Descriptive values from related tables can be added to the data block using three different methods • A Post-Query trigger that fires SELECT statements each time a record is fetched to the data block. • Use a view as the data source. It joins the tables and returns a single result set to the form. • Use a From Clause query as the data source. It also joins the tables and returns a single result set to the form. Oracle9i Developer: Developing Web Applications with Forms Builder

  39. Creating a Data Block with a FROM Clause Query as the Data Source • Post-Query trigger advantages: • Developer can use the Data Block Wizard to create the data block. • Developer can use the default data block DML commands. • Post-Query trigger disadvantages: • Descriptive items cannot be used as search arguments or be updated. • Intensive I/O since additional queries are executed for each row returned by the data block. Oracle9i Developer: Developing Web Applications with Forms Builder

  40. Creating a Data Block with a FROM Clause Query as the Data Source • View advantages: • The Data Block Wizard can be used to create the data block. • Performance may be better since a single SELECT statement is issued. • Descriptive values can be used as search arguments. • Descriptive values can be updated. Oracle9i Developer: Developing Web Applications with Forms Builder

  41. Creating a Data Block with a FROM Clause Query as the Data Source • View disadvantages: • DML statements cannot be issued against complex views. The developer will need to custom write the data block’s DML statements. • There is no association between a database view and the form it supports. The form can be disabled when the view is modified or dropped. • A large number of views can clutter the database and make it difficult to identify objects. Oracle9i Developer: Developing Web Applications with Forms Builder

  42. Creating a Data Block with a FROM Clause Query as the Data Source • FROM clause query advantages: • Performance may be better since a single SELECT statement is issued. • FROM clause query is a data block property setting and is part of the form. • Descriptive values can be used as search arguments. • Descriptive values can be updated. Oracle9i Developer: Developing Web Applications with Forms Builder

  43. Creating a Data Block with a FROM Clause Query as the Data Source • FROM clause query disadvantages: • DML statements cannot be issued against complex views. The developer will need to custom write the data block’s DML statements. • The Data Block Wizard cannot be used to create the data block. Oracle9i Developer: Developing Web Applications with Forms Builder

  44. Creating a Data Block with a FROM Clause Query as the Data Source • To create a data block based upon a FROM clause query: • Create a data block manually. • Set the Query Data Source Type property to FROM clause query • Add the select statement to the Query Data Source Name property • Create data block items to correspond to the expression in the select statement. It is preferable but not necessary to use the expression names as the data block item names. Oracle9i Developer: Developing Web Applications with Forms Builder

  45. Creating a Data Block with a FROM Clause Query as the Data Source Oracle9i Developer: Developing Web Applications with Forms Builder

  46. Where You Are and Where You’re Going • You have seen: • What objects are on the Object Navigator • How to operate the Object Navigator • How to create a detail data block • How to control the detail data block’s behavior using the Relations property • How to add descriptive values to the form using a Post-Query trigger, view, or FROM clause query Oracle9i Developer: Developing Web Applications with Forms Builder

  47. Where You Are and Where You’re Going • In the next chapter, you learn how to operate the Layout Editor to format the form. • You will also learn how to arrange data items, place graphics in a form, resize items, and a host of other formatting tasks. Oracle9i Developer: Developing Web Applications with Forms Builder

More Related