Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: NAVIGATION BUTTONS?

Re: NAVIGATION BUTTONS?

From: Andrew Tompkins <andrewto_at_kingfish.cse.tek.com>
Date: 1997/09/22
Message-ID: <ANDREWTO.97Sep22091525@kingfish.cse.tek.com>#1/1

Virginia K. Leung wrote:
>
> Hi,
>
> I am currently designing a form in FORM 4.5 with some NAVIGATION buttons
> on it.However, I have some problems arise regarding with this issue.
> I created FIRST, NEXT, PREVIOUS, and LAST buttons that are for my users to
> browse through the records by clicking the button. But I would like to
> enhance some enabled buttons issue. For example, when I click the LAST
> button, I would like the system know that I am in the last record and the
> system will right away disable NEXT button for preventing users to click.
> Also, the PREVIOUS button will be set to focus by the system. How do I do
> that? In what triggers? The trigger should be under which
> button/object/form?
>
> Please help. Your help is greatly appreciated! Thank you!
>
> Virginia
>

Try placing this in the When-New-Record-Instance trigger of the block containing the records you are moving through:

	IF :SYSTEM.CURSOR_RECORD = '1' THEN
		Set_Item_Property( 'Blk_Name.Btn_Previous', ENABLED, PROPERTY_FALSE );
	ELSE
		Set_Item_Property( 'Blk_Name.Btn_Previous', ENABLED, PROPERTY_TRUE );
	END IF;
	IF :SYSTEM.LAST_RECORD = 'TRUE' THEN
		Set_Item_Property( 'Blk_Name.Btn_Next', ENABLED, PROPERTY_FALSE );
	ELSE
		Set_Item_Property( 'Blk_Name.Btn_Next', ENABLED, PROPERTY_TRUE );
	END IF;

	IF :SYSTEM.CURSOR_RECORD = '1' THEN
		IF :SYSTEM.LAST_RECORD = 'TRUE' THEN
			<move cursor to someplace other than Btn_Next or Btn_Previous>
		ELSE
			Go_Item( 'Blk_Name.Btn_Next' );
		END IF;
	ELSE
		IF :SYSTEM.LAST_RECORD = 'TRUE' THEN
			Go_Item( 'BLk_Name.Btn_Previous' );
		ELSE
			<place input focus by default rules>
		END IF;
	END IF;

Substitute the name of the block containing the buttons for 'Blk_Name'. This sets the appropriate buttons on or off when you reach one end of the records. Make sure that the input focus is placed in the block containing the records that you are moving through. If this is the same block as that containing the buttons, the input focus should not be on 'Btn_Previous' or 'Btn_Next' as you cannot change the ENABLED property of the item holding the input focus. Placement of the input focus must be done after enabling/disabling the buttons for the same reason. This deals with the case where there is only one record or more than one record. You may want to assign :SYSTEM.CURSOR_RECORD and :SYSTEM.LAST_RECORD to local variables just prior to this code and use them in the appropriate places in the above code.

--Andy
-- 
-------------------------------------------------------
| Andrew G. Tompkins    | #include <disclaimer.std.h> |
| Software Design Eng.  ------------------------------|
| Tektronix, Inc.                                     |
| Phone: (503) 627-5172      fax: (503) 627-5548      |
| email: Andrew.Tompkins_at_tek.com (work)               |
|        andytom_at_teleport.com (home)                  |
| http://www.teleport.com/~andytom/                   |
-------------------------------------------------------
Received on Mon Sep 22 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US