Re: Not able to disable a button in FORMS 5.0

From: <wozi_at_dhc.net>
Date: Fri, 21 Jan 2000 19:31:14 -0800
Message-ID: <9DBCD0F5DB2C41A6.FA3EE382701A5D10.5E2FDEEFBF79C8C0_at_lp.airnews.net>


Kiran Anumolu wrote in message <3888C0A8.2A527FA4_at_hotmail.com>...
>I am experiencing some problems when I try to disable a
>button. This is using FORMS 5.0 (Developer 6) and
>Oracle 8.0.5 on NT 4.0
>
>I have a simple FORM with 2 text fields say
>FirstName and LastName fields and 2 buttons
>'SAVE' and 'CLOSE'. I have a menu attached to the FORM
>so the default menu is not there any more.
>Now, once the user enters a first name and last name
>and presses the 'SAVE' button I want the data to be
>inserted into the database and disable the 'SAVE'
>button.
>
>The Code in 'SAVE' button trigger is
>
>if(:system.form_status = 'CHANGED') then
> commit_form;
>end if;
>Every thing works fine once the users enters
>some data and presses 'SAVE'. The data goes into the
>table (the 'SAVE' button is still enabled though).
>
>Now, in order to disable the button I wrote this
>in the POST-INSERT trigger (I tried in ON-INSERT also)
>of the block.
>SET_ITEM_PROPERTY('SAVE', ENABLED, PROPERTY_FALSE);
>
>Now, with this new code added, the 'SAVE' button
>gets disabled once the user presses it, and I get
>a message 'Transaction completed 1 row inserted'
>some thing like that, indicating that the row is
>inserted into the table, but NO. It does not.
>So the button is getting disabled but the new
>data in not commited into the database.
>
>Any ideas as to what I am missing here?

You are trying to disabled the 'save' button while it has focus. Therefore, what you should do is give focus to the 'close' button after commit .
Then disable the 'save' button.

For example, after comit; issue GO_ITEM('Block_name.Close'); Then, disable the 'save' button

good luck. Received on Sat Jan 22 2000 - 04:31:14 CET

Original text of this message