Presentation is loading. Please wait.

Presentation is loading. Please wait.

© 2007 by Prentice Hall9-1 Introduction to Oracle 10g Chapter 9 Customizing Forms James Perry and Gerald Post.

Similar presentations


Presentation on theme: "© 2007 by Prentice Hall9-1 Introduction to Oracle 10g Chapter 9 Customizing Forms James Perry and Gerald Post."— Presentation transcript:

1 © 2007 by Prentice Hall9-1 Introduction to Oracle 10g Chapter 9 Customizing Forms James Perry and Gerald Post

2 © 2007 by Prentice Hall9-2 Chapter Outline Setting the Form Structure Designing Form Triggers Creating Useful Forms Tools Using Multiple Canvases Creating Web Forms with JDeveloper

3 © 2007 by Prentice Hall9-3 Bedrooms Bathrooms Sq Feet Age/Built Price Sale Status 2 3 4 5 or more 1 1.5 2 2.5 3 4 or more 1000 2000 3000 4000 or more 1900 1970 1980 1990 2000 or later Min: Max: For sale Pending Sold Matches 9.1: The initial sketch of the search form

4 © 2007 by Prentice Hall9-4 Database Server Items Frame Canvas Block1 (Query) Item1 Item2 Item3 Block2 (Query) Item1 Item2 Item3 9.2: The structure of Oracle forms

5 © 2007 by Prentice Hall9-5 9.3: Initial canvas, data block, and items for search form Creating a canvas and simple data block

6 © 2007 by Prentice Hall9-6 9.4 Query Data Source Columns data entry

7 © 2007 by Prentice Hall9-7 9.5 The intermediate search form

8 © 2007 by Prentice Hall9-8 9.6 Search form results

9 © 2007 by Prentice Hall9-9 FormBlockItem 1. Pre-Logon 2. On-Logon 3. Post-Logon 4. Pre-Form 5. When-Create-Record 6. Pre-Block 7. Pre-Record 8. Pre-Text-Item 9. When-New-Form-Instance 10. When-New-Block-Instance 11. When-New-Record-Instance 12. When-New-Item-Instance 1. Post-Text-Item 2. Post-Record 3. Post-Block 4. Post-Form 5. On-Rollback 6. Pre-Logout 7. On-Logout 8. Post-Logout Enter Exit 9.7 Sequence of primary trigger events

10 © 2007 by Prentice Hall9-10 9.8 First firing of the Post-Item trigger Defining form events

11 © 2007 by Prentice Hall9-11 DECLARE tax NUMBER(9,2); price NUMBER(9,2); AvgSalary NUMBER(10,3); tax_rate CONSTANT NUMBER := 0.07; BEGIN tax := price * tax_rate; SELECT Avg(Salary) INTO AvgSalary FROM Employee; IF (condition) --statements ELSE --statements END IF; WHILE (j < 10) LOOP j := j + 1; END LOOP; EXCEPTION WHEN (error event) THEN … END; Create variables Calculations Retrieve data Evaluate conditions Repeat loop Catch errors 9.9 Common PL/SQL commands Creating and editing triggers

12 © 2007 by Prentice Hall9-12 9.10 Some of the standard functions for Oracle forms

13 © 2007 by Prentice Hall9-13 9.11 Help descriptions for standard functions

14 © 2007 by Prentice Hall9-14 Step through code Variables in the trigger Form values Break point Current line Start debug 9.12 Some options in the forms debug console

15 © 2007 by Prentice Hall9-15 Error message 9.13 Message generated by the division error

16 © 2007 by Prentice Hall9-16 Add a letter to the ID Try to save the changes Record the codes from the error message 9.14 Trapping a database error generated on the form

17 © 2007 by Prentice Hall9-17 9.15 Automatically generated AgentID Creating sequences

18 © 2007 by Prentice Hall9-18 Validation options 9.16 Basic validation properties Validating form input

19 © 2007 by Prentice Hall9-19 Try to set a recent year Person is too young 9.17 Validation error message

20 © 2007 by Prentice Hall9-20 Table 9.1: Properties for the text box in the sub-form to count PropertyValue NameMatchCount EnableNo Keyboard NavigableNo Data TypeNumber Calculation ModeSummary Summary FunctionCount Summarized BlockLISTINGRESULTS Summarized ItemLISTINGID Database ItemNo VisibleNo Width5 Height1 PromptCount

21 © 2007 by Prentice Hall9-21 Table 9.2: Properties for the text box to display total PropertyValue NameMatchCount EnabledNo JustificationRight Data TypeNumber Format Mask9,990 Calculation ModeFormula :LISTINGRESULTS.MatchCount Database ItemNo PromptNumber of Matches

22 © 2007 by Prentice Hall9-22 9.18 Sample search results with count of matches

23 © 2007 by Prentice Hall9-23 9.19 Form design with second canvas Using multiple canvases

24 © 2007 by Prentice Hall9-24 Stacked canvas button Draw the viewport 9.20 Adding a stacked canvas

25 © 2007 by Prentice Hall9-25 9.21 Displaying the stacked canvas

26 © 2007 by Prentice Hall9-26 Assign the canvas and the page 9.22 Specifying the canvas and page for data items

27 © 2007 by Prentice Hall9-27 9.23 Tab canvas with links to Property and Owner data

28 © 2007 by Prentice Hall9-28 Right-click Click 9.24 Creating a new Data Connection in JDeveloper Creating Web forms with JDeveloper

29 © 2007 by Prentice Hall9-29 9.25 Choosing data tables

30 © 2007 by Prentice Hall9-30 9.26 Selecting attributes from the Properties entity

31 © 2007 by Prentice Hall9-31 HTML Items Data Items Style 9.27 Design of the initial form

32 © 2007 by Prentice Hall9-32 9.28 Initial form

33 © 2007 by Prentice Hall9-33 9.29 The Struts Page Flow Diagram Adding a search form

34 © 2007 by Prentice Hall9-34 9.30 The search form

35 © 2007 by Prentice Hall9-35 9.31 The page flow

36 © 2007 by Prentice Hall9-36 9.32 The final form


Download ppt "© 2007 by Prentice Hall9-1 Introduction to Oracle 10g Chapter 9 Customizing Forms James Perry and Gerald Post."

Similar presentations


Ads by Google