Home » Developer & Programmer » Forms » disable button after press (Prevent multi click) (form 6i , oracle 10g database)
disable button after press (Prevent multi click) [message #685702] Wed, 09 March 2022 21:47 Go to next message
shahzad-ul-hasan
Messages: 615
Registered: August 2002
Senior Member
Dear
i want to disable button after user press it only one time.
When Button Pressed
declare
begin
set_item_property('Post',enabled,property_false);
end;
but after press it. button is not on disabled mode.
please advised.

[Updated on: Wed, 09 March 2022 21:48]

Report message to a moderator

Re: disable button after press (Prevent multi click) [message #685703 is a reply to message #685702] Thu, 10 March 2022 00:17 Go to previous messageGo to next message
jury68000
Messages: 33
Registered: October 2019
Member
I doubt it is possible to do it just like that (but if anyone knows it is, please share)
What I would do in this kind of need, I would
go_item
to some other item (if possible, but I guess it always is) and do a set_item_property('item', enabled, false) from there.

[Updated on: Thu, 10 March 2022 00:17]

Report message to a moderator

Re: disable button after press (Prevent multi click) [message #685713 is a reply to message #685703] Thu, 10 March 2022 14:53 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Create a parameter; let's call it BTN_PRESSED. Initially, set its value to 'N'.

WHEN-BUTTON-PRESSED trigger might then look like this:
-- the 1st time you click the button, IF part will be executed.
-- Next time, ELSE part will be executed, and NULL; won't do anything

if :parameter.btn_pressed = 'N' then
   -- do something here; I presume you aren't just clicking the button
   -- and it does nothing; right?
   
   -- set the parameter value so that it nows says "button was pressed"
   :parameter.btn_pressed := 'Y';
else
   null;
end if;
Re: disable button after press (Prevent multi click) [message #685719 is a reply to message #685713] Mon, 14 March 2022 07:58 Go to previous message
Frank
Messages: 7901
Registered: March 2000
Senior Member
The problem with using globals like LF suggests is that there will always be some edge case scenario where the global is not reset correctly, so the user has to restart the form or application to re-enable the button.
In such cases it could be better to secure the called code from being executed twice, instead of fixing it in the front end.
But if your userstories are simple enough, it should definitely do the trick
Previous Topic: pre_insert
Next Topic: Conflict of POST-QUERY trigger with LOVs with Validate from List Propoerty
Goto Forum:
  


Current Time: Thu Mar 28 06:38:44 CDT 2024