Home » Developer & Programmer » Forms » Programatically press the button
Programatically press the button [message #203633] Wed, 15 November 2006 22:01 Go to next message
wency
Messages: 450
Registered: April 2006
Location: Philippines
Senior Member

Hi all,

Is it possible to press a button programatically?
If so, how should I do that? What will be the code?

Thanks!
Re: Programatically press the button [message #203641 is a reply to message #203633] Wed, 15 November 2006 22:50 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Put all the code associated with the button into a procedure and then call that procedure from the When-Button-Pressed trigger and from your other custom code.

David
Re: Programatically press the button [message #203654 is a reply to message #203633] Wed, 15 November 2006 23:51 Go to previous messageGo to next message
wency
Messages: 450
Registered: April 2006
Location: Philippines
Senior Member

Thanks for the reply David but I don't want to go that way.
What if I have to create a demo program that must show the button is press without human intervention?
What I need is like save_btn.click on powerbuilder or save_btn.submit is ASP.

Is it possible in oracle 5?

If not then I have do some trick on buttons so it will look like being pressed. Razz

[Updated on: Wed, 15 November 2006 23:52]

Report message to a moderator

Re: Programatically press the button [message #203667 is a reply to message #203654] Thu, 16 November 2006 00:21 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
You could make the button navigable, navigate to it, and then perform a "do_key('Enter');". See if that causes the button to fire.

David
Re: Programatically press the button [message #203698 is a reply to message #203654] Thu, 16 November 2006 01:29 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
wency
What if I have to create a demo program that must show the button is press without human intervention?

Create a (Power Point) presentation instead.
Re: Programatically press the button [message #203760 is a reply to message #203633] Thu, 16 November 2006 04:23 Go to previous messageGo to next message
wency
Messages: 450
Registered: April 2006
Location: Philippines
Senior Member

Hi David,

It didn't work.
I tried the code below but I got FRM-41009 error.

go_item('bir_block.download');
do_key('PRESS');
Re: Programatically press the button [message #203884 is a reply to message #203760] Thu, 16 November 2006 19:18 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Please reread my post. I said 'enter' not 'press'.

David
Re: Programatically press the button [message #203886 is a reply to message #203633] Thu, 16 November 2006 19:21 Go to previous messageGo to next message
wency
Messages: 450
Registered: April 2006
Location: Philippines
Senior Member

'enter' didn't work David
Re: Programatically press the button [message #203892 is a reply to message #203886] Thu, 16 November 2006 19:39 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
When you say "didn't work" do you mean that the message/pause pair you have in the button code to aid in debugging didn't display or that the button didn't changed shape?

David
Re: Programatically press the button [message #203896 is a reply to message #203633] Thu, 16 November 2006 21:05 Go to previous messageGo to next message
wency
Messages: 450
Registered: April 2006
Location: Philippines
Senior Member

yes, message did not display.

[Updated on: Thu, 16 November 2006 21:06]

Report message to a moderator

Re: Programatically press the button [message #203916 is a reply to message #203896] Thu, 16 November 2006 23:27 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Are you able to navigate to the button via the keyboard?

David
Re: Programatically press the button [message #203933 is a reply to message #203633] Fri, 17 November 2006 00:20 Go to previous messageGo to next message
wency
Messages: 450
Registered: April 2006
Location: Philippines
Senior Member

Yes. When I use go_item, I also get there but it doesn't press the button.
Re: Programatically press the button [message #203956 is a reply to message #203933] Fri, 17 November 2006 01:38 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Okay, when you navigate there and press the 'enter' key does the button fire? Are you in enter-query mode?

David
Re: Programatically press the button [message #204249 is a reply to message #203633] Sun, 19 November 2006 18:55 Go to previous message
wency
Messages: 450
Registered: April 2006
Location: Philippines
Senior Member

I got it! I use execute_trigger.
Thanks to all of you.. Razz
Previous Topic: NEXT record
Next Topic: How to acquire value from a text box
Goto Forum:
  


Current Time: Thu Dec 08 16:37:31 CST 2016

Total time taken to generate the page: 0.09239 seconds