SetServerServiceClasses – PB Docs 150

SetServerServiceClasses method (DataWindows)

Description

Tells the server component to trigger custom events defined
in user objects for data validation. These user objects, referred
to as service classes, must be defined in the PBL or
PBD containing the DataWindow object for the server component.

Controls

DataWindow type

Method applies to

Web

Server component

Syntax

[Web DataWindow server component]

Argument

Description

dwcomponent

A reference to a Web DataWindow server
component.

serviceclassnames

A string whose value is a list of PowerBuilder
custom class user objects. The user objects must be in the PBL or PBD containing the DataWindow
for the server component. Separate user object names with a semicolon.

Return Values

Returns 1 if it succeeds and –1 if a specified service
class does not exist.

Usage

The main use of service classes is to provide data validation
using server-side business logic.

Service classes implement one or more user-defined events
with these names and signatures:

The custom events can use the same return codes as the corresponding standard
DataWindow events documented in Chapter 8, “DataWindow Events.” By setting a return code, a custom
event can cause the event action to be canceled in the server component.

When the standard DataWindow event occurs in the server component,
the component triggers the custom event in each of the listed service
classes. One or more of the components can implement the event.
A service class only needs to implement the events whose outcome
it wants to influence. Any of the service classes can set an event
return code that cancels the event action in the server component.

note.png Runtime errors

Instantiated service objects run in the same objects space
as the server component. If a runtime error occurs in the service
object, it could cause HTML generation to fail.

For information about using the Web DataWindow, see the DataWindow Programmers
Guide
.

Examples

This JavaScript example for a server-side script
specifies a list of service classes that implement events:

See Also


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