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

Coding for the Web ActiveX – PB Docs 100 – PowerBuilder Library

Coding for the Web ActiveX – PB Docs 100

Coding for the Web ActiveX

You can write scripts in the Web page to manipulate the DataWindow
data and presentation. The methods and events are similar to those
available in a standard DataWindow, but the events have been renamed
to match JavaScript naming conventions.

The properties, methods, and events—as well as the
DataWindow object properties and expression functions—are
documented in the DataWindow Reference
.

You can see a list of the properties, methods, and events
for the controls on the Components page of the System Tree or in
another tool for examining ActiveX controls.

The Script editor lets you write scripts for all events of
the Web ActiveX.

proc.gif To write a script for a particular event in a
Web target:

  1. In Page view, select a Web ActiveX that
    you have inserted in the Web page
    or

    In
    the Script editor, select the name of the DataWindow Web ActiveX
    in the leftmost drop-down list.

  2. In the Script editor, select an event from the
    second drop-down list. The drop-down list shows the event name and
    the parameters whose values are available in the script.

  3. In the third drop-down list, select JScript as
    the scripting language.

  4. Write code for the event. To call methods or access
    properties without typing, drag them from the Page tab of the System
    Tree to the editor.

Datatypes for method arguments and return values

Primitive types

JScript supports three primitive datatypes:

  • string
  • number
  • boolean

Method arguments and return values and event parameters are
one of these basic types, or an object type.

DataWindow methods that deal with specific data types, such
as GetItemDecimal, are not available for the Web ActiveX. Instead,
you use the method that handles the more general data type, such
as GetItemNumber.

Date data types

PowerBuilder has several date and time data types, but in
JScript these all map to the Date object.

Enumerated data types

PowerBuilder enumerated data types have named values, but
in JScript, each value is a number. The list of numbers (and their
meaning) is documented in the DataWindow Reference
for
each enumerated data type.

Setting event return codes

The event return codes documented for DataWindow events are
also valid for the Web ActiveX. However, JScript does not support
return values for events. Instead, to specify a return code, you
call the SetActionCode method as the last line in the event script.

For example, the return code of the onItemError event allows
you to determine what happens when user-entered data fails a validation
rule. By specifying a return code of 3, you cause the Web ActiveX
to reject the data but allow focus to change. This statement would
be the last line of the onItemError event script:


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