oracle 10g forms lesson 10

30
10 Copyright © 2004, Oracle. All rights reserved. Creating Noninput Items

Upload: kama3

Post on 16-Jan-2015

24.181 views

Category:

Technology


4 download

DESCRIPTION

Creating Noninput Items

TRANSCRIPT

Page 1: Oracle 10g Forms Lesson 10

10Copyright © 2004, Oracle. All rights reserved.

Creating Noninput Items

Page 2: Oracle 10g Forms Lesson 10

10-2 Copyright © 2004, Oracle. All rights reserved.

Objectives

After completing this lesson, you should be able to do the following:

• Identify item types that do not allow input

• Create a display item

• Create an image item

• Create a button

• Create a calculated item

• Create a hierarchical tree item

• Create a bean area item

Page 3: Oracle 10g Forms Lesson 10

10-3 Copyright © 2004, Oracle. All rights reserved.

Noninput Items Overview

Item types that do not accept direct user input include:

• Display items

• Image items

• Buttons

• Calculated items

• Hierarchical tree items

• Bean area items

Page 4: Oracle 10g Forms Lesson 10

10-4 Copyright © 2004, Oracle. All rights reserved.

Display Items

Display items:

• Are similar to text items.

• Cannot:– Be edited– Be queried– Be navigated

to– Accept user

input

• Can display:– Nonbase table information– Derived values

Page 5: Oracle 10g Forms Lesson 10

10-5 Copyright © 2004, Oracle. All rights reserved.

Creating a Display Item

Page 6: Oracle 10g Forms Lesson 10

10-6 Copyright © 2004, Oracle. All rights reserved.

Image Items

Use image items to display images:

• From file system—supported file type

• From database—LONG RAW column or a BLOB column

Page 7: Oracle 10g Forms Lesson 10

10-8 Copyright © 2004, Oracle. All rights reserved.

Image File Formats

Image item

Image files Image files

Read Write

PICT

TPIC

CALS

TIFF

GIF

JFIF

BMP

RAS

CALS

GIF

BMP

RAS

JPEG

TIFF

JFIF

JPEG

PICTTPIC

Page 8: Oracle 10g Forms Lesson 10

10-9 Copyright © 2004, Oracle. All rights reserved.

Creating an Image Item

Page 9: Oracle 10g Forms Lesson 10

10-10 Copyright © 2004, Oracle. All rights reserved.

Setting Image-Specific Item Properties

• Image Format

• Image Depth

• Compression Quality

• Display Quality

• Sizing Style

• Show Horizontal Scroll Bar

• Show Vertical Scroll Bar

Page 10: Oracle 10g Forms Lesson 10

10-12 Copyright © 2004, Oracle. All rights reserved.

Push Buttons

Push buttons:

• Cannot display or represent data

• Are used to initiate an action

• Display as:– Text button– Iconic

Page 11: Oracle 10g Forms Lesson 10

10-13 Copyright © 2004, Oracle. All rights reserved.

Push Button Actions

Use buttons to:

• Move input focus

• Display an LOV

• Invoke an editor

• Invoke another window

• Commit data

• Issue a query

• Perform calculations

Page 12: Oracle 10g Forms Lesson 10

10-14 Copyright © 2004, Oracle. All rights reserved.

Creating a Push Button

Page 13: Oracle 10g Forms Lesson 10

10-15 Copyright © 2004, Oracle. All rights reserved.

Setting Push Button Properties

• Label

• Iconic

• Icon Filename

• Default Button

• Mouse Navigate

• Tooltip

• Tooltip Visual Attribute Group

Page 14: Oracle 10g Forms Lesson 10

10-16 Copyright © 2004, Oracle. All rights reserved.

Calculated Items

What are calculated items?

• They accept item values that are based on calculations.

• They are read-only.

• They can be expressed as:– Formula– Summary

Page 15: Oracle 10g Forms Lesson 10

10-17 Copyright © 2004, Oracle. All rights reserved.

Creating a Calculated Item bySetting Properties

• Formula– A calculated item value is the result of a horizontal

calculation.– It involves bind variables.

• Summary– A calculated item value is a vertical calculation.– A summary is performed on values of a single item

over all rows in a block.

Page 16: Oracle 10g Forms Lesson 10

10-18 Copyright © 2004, Oracle. All rights reserved.

Setting Item Properties for the Calculated Item

• Formula– Calculation Mode– Formula

• Summary– Calculation Mode– Summary Function– Summarized Block– Summarized Item

Page 17: Oracle 10g Forms Lesson 10

10-19 Copyright © 2004, Oracle. All rights reserved.

Summary Functions

• AVG

• COUNT

• MAX

• MIN

• STDDEV

• SUM

• VARIANCE

Page 18: Oracle 10g Forms Lesson 10

10-20 Copyright © 2004, Oracle. All rights reserved.

Calculated Item Based on a Formula

ORDERS

Item#Prod

IdUnitPrice Quantity

ItemTotal

12

43

2001205025

5493

1,00048045075

NVL((:order_items.unit_price

* :order_items.quantity),0)

Formulaitem

Orders

Items

Description

Page 19: Oracle 10g Forms Lesson 10

10-21 Copyright © 2004, Oracle. All rights reserved.

Rules for Calculated Item Formulas

Create calculated item formulas according to the following rules:

• A formula item must not invoke restricted built-ins.

• A formula item cannot execute any DML statements.

• Do not terminate a PL/SQL expression with a semicolon.

• Do not enter a complete PL/SQL statement in assignment expressions.

Page 20: Oracle 10g Forms Lesson 10

10-22 Copyright © 2004, Oracle. All rights reserved.

Calculated Item Based on a Summary

ORDERS

12

43

2001205025

5493

1,00048045075

2,005Order Total

Summarizeditem

Summaryitem

Item#Prod

IdUnitPrice Quantity

ItemTotalDescription

Orders

Items

Page 21: Oracle 10g Forms Lesson 10

10-23 Copyright © 2004, Oracle. All rights reserved.

Rules for Summary Items

• Summary item must reside in:– The same block as the summarized item– A control block with Single Record property set to

Yes

• Summarized item must reside in:– A data block with Query All Records property or

Precompute Summaries property set to Yes– A control block

• Datatype of summary item must be Number, unless using MAX or MIN

Page 22: Oracle 10g Forms Lesson 10

10-24 Copyright © 2004, Oracle. All rights reserved.

Creating a Hierarchical Tree Item

Page 23: Oracle 10g Forms Lesson 10

10-25 Copyright © 2004, Oracle. All rights reserved.

Setting Hierarchical Tree Item Properties

• Allow empty branches

• Multi selection

• Show lines

• Show symbols

• Record group

• Data query

Page 24: Oracle 10g Forms Lesson 10

10-26 Copyright © 2004, Oracle. All rights reserved.

Bean Area Items

The Bean Area item enables you to:

• Add a JavaBean to a form

• Extend Forms functionality

• Interact with client machine

• Reduce network traffic

Page 25: Oracle 10g Forms Lesson 10

10-27 Copyright © 2004, Oracle. All rights reserved.

Creating a Bean Area Item

Create bean area in Layout Editor

Convert existing itemto bean area

Page 26: Oracle 10g Forms Lesson 10

10-28 Copyright © 2004, Oracle. All rights reserved.

Setting Bean Area Item Properties

Page 27: Oracle 10g Forms Lesson 10

10-29 Copyright © 2004, Oracle. All rights reserved.

The JavaBean at Run Time

Page 28: Oracle 10g Forms Lesson 10

10-30 Copyright © 2004, Oracle. All rights reserved.

Summary

In this lesson, you should have learned that:

• The following item types do not allow input: – Display items– Image items– Push buttons– Calculated items– Hierarchical tree items– Bean area items

• You create noninput items by:– Changing the type of an existing item and setting

certain properties– Using the appropriate tool in the Layout Editor

Page 29: Oracle 10g Forms Lesson 10

10-31 Copyright © 2004, Oracle. All rights reserved.

Summary

• You can use:– A display item to show nonbase table information– An image item to display an image– A push button to initiate action– A calculated item to display the results of a formula

or a summary function of another item– A hierarchical tree item to display related data in a

hierarchical fashion– A bean area item to execute client-side Java code

Page 30: Oracle 10g Forms Lesson 10

10-32 Copyright © 2004, Oracle. All rights reserved.

Practice 10 Overview

This practice covers the following topics:

• Creating display items

• Creating an image item

• Creating iconic buttons

• Creating calculated items:– Formula– Summary

• Creating a bean area item