Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

RegisterEvent – PB Docs 2021 – PowerBuilder Library

RegisterEvent – PB Docs 2021

RegisterEvent

PowerScript function

Description

Registers the PowerBuilder user defined event so
they can be triggered in JavaScript.

Applies to

WebBrowser
control

Syntax

Argument

Description

controlname

The name of the WebBrowser control.

eventname

The name of the user-defined event to be
registered.

Return value

Integer.

Returns values as follows.

1 — the event is registered successfully.

-1 — the event is already registered.

-2 — failed to get the browser instance.

Usage

The initialization of the WebBrowser control is run as a separate
process from the PowerBuilder application. Therefore, if the WebBrowser
control is being initialized while you register the event in PowerBuilder,
the registration will fail. To avoid such issue, it is recommended that
you trigger the NavigateStart event
first. If NavigateStart can be triggered
successfully, it indicates that WebBrowser is completely initialized. For
example, you can add the following code to the NavigateStart event:

Example 1

The following example defines a PowerBuilder user event which is
then triggered in JavaScript in wb_1, and the result of the JavaScript
which is returned in a JSON string is parsed by the JSONParser
object.

Note that this user event should not call any other WebBrowser
function, otherwise the application may get stuck.

Example 2

The following example registers a PowerBuilder user event in the
WebBrowser NavigationProgressIndex event,
and then triggers the user event in JavaScript in an HTML file.

Step 1: Defines the user event: ue_getstring in
the WebBrowser control.

Step 2: Registers the user event: ue_getstring
in the WebBrowser NavigationProgressIndex
event.

Note that the NavigationProgressIndex event will be triggered
multiple times when the HTML page is being loaded.

Step 3: Triggers the user event in JavaScript in the HTML page:
page.html.

Step 4: Loads the HTML page in the WebBrowser control.

See also

CancelDownload

EvaluateJavascriptAsync

EvaluateJavascriptSync

GetSource

GoBack

GoForward

Navigate

PrintAsPDF

PauseDownload

ResumeDownload

Refresh

StopNavigation

UnregisterEvent

Zoom


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x