weboperation

Defines an operation that will be executed on the client browser.

weboperation OperationName
          
{ScopeBlock}
{ParamsBlock}
{JavaScriptBlock}
end

Parameters

Parameters
Parameter Description
OperationName Literal name of the operation; maximum length of 32 bytes. The characters can be letters (A-Z), digits (0-9), and underscores (_), and must begin with a letter (A-Z).
Other Arguments
Parameter Description
ScopeBlock Specifies the data to be included in a DSP request-response exchange. For more information, see scope.
ParamsBlock Defines the operation's parameters. For more information, see params.
JavaScriptBlock Defines a block of JavaScript code that conforms to the Data Format of External Client-Side Triggers and Operations. For more information, see javascript.

This block is required when maintaining JavaScript in the Uniface IDE. It can be omitted if the JavaScript definitions are externally defined, for example in an external layout or JavaScript files that are available in the runtime environment.

Return Values

None

Use

Use in Dynamic Server Page components.

Description

Use the weboperation instruction to define a client-side operation. Client-side operations are executed in the client browser and can only be implemented as JavaScript. The JavaScript code must be entered between the javascript and endjavascript keywords. The JavaScript code can be defined internally using the ProcScript Editor, or externally in your own DSP layout or JavaScript files. In this case, you can use your own preferred editor.

Parameters for client-side operations are optional and must be declared in ProcScript preceding the javascript instruction. Variables, however, must be declared in JavaScript.

Client-side operations can be activated from the server using the webactivate ProcScript command, or invoked from the browser using the JavaScript API (uniface.createInstance).

If an operation is defined with the same name as the weboperation, the last one defined is the one that is used.

For more information on defining and using client-side operations, see Client-Side Triggers and Operations.

weboperation Alert 
scope		
 input
 output
 operation INST1.someOper 
endscope

javascript  ; part of ProcScript so ProcScript comment can follow
  Alert("THIS IS JAVASCRIPT CODING"); /* JavaScriptCode and so javaScript syntax */
endjavascript  ; part of ProcScript so ProcScript comment can follow
end 
History

Version

Change

9.5.01

Introduced

Related Topics