How to programmatically click a button via LotusScript?

How can I do that?

Since there’s no way I can execute a JavaScript function/code directly from LotusScript, a workaround could be to place it in a button within a form.

The problem now is, how can I programmatically click a button within a form from LotusScript?

Similar to button.click() in JavaScript or button.performClick() in vb.net?

Subject: How to programmatically click a button via LotusScript?

anyone?

Subject: RE: How to programmatically click a button via LotusScript?

Assume we have a form…in which we have a button called “testing”.I will call an agent in this button…which does creating a form with print statements as follows:str= “Test?CreateDocument”

Print ||

Print |

|

Subject: RE: How to programmatically click a button via LotusScript?

Viswa, I believe Aldrin is trying to call a button from an agent, not the other way around.

Trish

Subject: RE: How to programmatically click a button via LotusScript?

On HTML properties of the button, give name and/or id the value of “myButton” (in this example).

Then in your script:

Dim ws As New NotesUIWorkspace

Call ws.URLOpen( “javascript: document.forms[0].myButton.click();” )

Voilà.

Subject: RE: How to programmatically click a button via LotusScript?

Hi Jean Paul,

thanks so much for this honorable hack :slight_smile:

Cheers

Jens

Subject: RE: How to programmatically click a button via LotusScript?

Thank you for the effort, but in Lotus Notes client, as I’ve indicated in the category of this post.

Subject: How to programmatically click a button via LotusScript?

According to designer help, “A Button object has no properties or methods.” You can’t call that click event with LS - it is only instantiated in the user interface when the user clicks. You’ll have to put your javascript code somewhere else. What exactly are you trying to accomplish?

Trish

Subject: RE: How to programmatically click a button via LotusScript?

What i’m trying to accomplish?

here it goes…

This is in Notes client, I have an applet in my form like VB.net datagrid. When the user double-clicks an item (row) in that grid, it will kick a JavaScript function. This JavaScript function fires a button which contains LotusScript codes (display dialogbox - ws.dialogBox() - to edit the selected entry in the applet). This works fine.

Now, when the user clicks OK, data changes made should be passed back to the applet to display the changes, and this could be done via JavaScript.

JApplet → JavaScript function-> LotusScript button → ?JavaScript button? → JApplet

Subject: How to programmatically click a button via LotusScript?

anyone?