les20
DESCRIPTION
TRANSCRIPT
20Copyright © 2004, Oracle. All rights reserved.
Navigation
20-2 Copyright © 2004, Oracle. All rights reserved.
Objectives
After completing this lesson, you should be able to do the following:
• Distinguish between internal and external navigation
• Control navigation with properties
• Describe and use navigation triggers to control navigation
• Use navigation built-ins in triggers
20-3 Copyright © 2004, Oracle. All rights reserved.
Navigation Overview
• What is the navigational unit?– Outside the form– Form– Block– Record– Item
• Entering and leaving objects
• What happens if navigation fails?
20-5 Copyright © 2004, Oracle. All rights reserved.
v
^x
Understanding Internal Navigation
Next Record
Exit item
Exit record
Enter record
Enter item
20-7 Copyright © 2004, Oracle. All rights reserved.
Using Object Properties to Control Navigation
• Block– Navigation Style– Previous Navigation Data Block– Next Navigation Data Block
• Item– Enabled– Keyboard Navigable– Mouse Navigate – Previous Navigation Item– Next Navigation Item
20-8 Copyright © 2004, Oracle. All rights reserved.
Using Object Properties to Control Navigation
• Form module– Mouse
Navigation Limit– First Navigation
Data Block
20-9 Copyright © 2004, Oracle. All rights reserved.
v
^
Mouse Navigate Property
x
MOUSE NAVIGATE = YES
Exit item
Exit record
Exit block
Enter block
Enter record
Enter item
20-10 Copyright © 2004, Oracle. All rights reserved.
v
^x
Writing Navigation Triggers
Pre- and Post-
When-New-<object>-Instance
20-11 Copyright © 2004, Oracle. All rights reserved.
Navigation Triggers
When-New-<object>-Instance
Fire after navigation
Fire even when validation unit is higher than the trigger object
Allow restricted and unrestricted built-ins
Are not affected by failure
Pre- and Post-
Fire during navigation
Do not fire if validation unit is higher than trigger object
Allow unrestricted built-ins
Handle failure by returning to initial object
20-12 Copyright © 2004, Oracle. All rights reserved.
When-New-<object>-Instance Triggers
• When-New-Form-Instance
• When-New-Block-Instance
• When-New-Record-Instance
• When-New-Item-Instance
20-13 Copyright © 2004, Oracle. All rights reserved.
SET_<object>_PROPERTY Examples
SET_FORM_PROPERTY(FIRST_NAVIGATION_BLOCK,
’ORDER_ITEMS’);
SET_BLOCK_PROPERTY(’ORDERS’, ORDER_BY,
’CUSTOMER_ID’);
SET_RECORD_PROPERTY(3, ’ORDER_ITEMS’, STATUS,
QUERY_STATUS);
SET_ITEM_PROPERTY(’CONTROL.stock_button’,
ICON_NAME, ’stock’);
20-15 Copyright © 2004, Oracle. All rights reserved.
The Pre- and Post-Triggers
• Pre/Post-Form
• Pre/Post-Block
• Pre/Post-Record
• Pre/Post-Text-Item
20-17 Copyright © 2004, Oracle. All rights reserved.
Post-Block Trigger Example
Disabling Stock button when leaving the ORDER_ITEMS block:
SET_ITEM_PROPERTY(’CONTROL.stock_button’,
enabled, property_false);
20-18 Copyright © 2004, Oracle. All rights reserved.
v
^
The Navigation Trap
A Post-Text-Item
Pre-Text-Item
Pre-Text-Item
B
20-19 Copyright © 2004, Oracle. All rights reserved.
Using Navigation Built-Ins in Triggers
GO_FORM
GO_BLOCK
GO_ITEM
GO_RECORD
NEXT_BLOCK
NEXT_ITEM
NEXT_KEY
NEXT_RECORD
NEXT_SET
UP
DOWN
PREVIOUS_BLOCK
PREVIOUS_ITEM
PREVIOUS_RECORD
SCROLL_UP
SCROLL_DOWN
20-20 Copyright © 2004, Oracle. All rights reserved.
IF CHECKBOX_CHECKED(’ORDERS.order_mode’) --Online
THEN -- order
ORDERS.order_status := 4; --Credit order
GO_ITEM(‘ORDERS.order_status’);
END IF;
IF CHECKBOX_CHECKED(’ORDERS.order_mode’) --Online
THEN -- order
ORDERS.order_status := 4; --Credit order
GO_ITEM(‘ORDERS.order_status’);
END IF;
Using Navigation Built-Ins in Triggers
• When-New-Item-Instance
• Pre-Text-Item
20-21 Copyright © 2004, Oracle. All rights reserved.
Summary
In this lesson, you should have learned that:
• External navigation is visible to the user, while internal navigation occurs behind the scenes.
• You can control navigation with properties of the form, block, or item:– Set in Navigation category of the Property Palette
OR– Use SET_[FORM | BLOCK | ITEM]_PROPERTY
20-22 Copyright © 2004, Oracle. All rights reserved.
Summary
• Navigation triggers:– Those that fire during navigation (watch out for the
navigation trap):[Pre | Post] - [Form | Block | Item]
– Those that fire after navigation: When-New- [Form | Block | Record | Item] -Instance
• You can use navigation built-ins in triggers (except for triggers that fire during navigation):– GO_[FORM | BLOCK | RECORD | ITEM]– NEXT_[BLOCK | RECORD | ITEM | KEY | SET]– UP– DOWN– PREVIOUS_[BLOCK | RECORD | ITEM]– SCROLL_[UP | DOWN]
20-23 Copyright © 2004, Oracle. All rights reserved.
Practice 20 Overview
This practice covers the following topics:
• Registering the bean area’s JavaBean at form startup
• Setting properties on a Pluggable Java Component at form startup
• Executing a query at form startup
• Populating product images when cursor arrives on each record of the ORDER_ITEMS block