ClientAction - cWebObject

Calls a function of the client JavaScript object

Type: Procedure

Parameters: String sName String[] aOptParams Variant vActionData

sNameName of the method to call on client
aOptParams(optional) Array of parameters to pass to the client method
vActionData(optional) Optional set of structured data associated with the client action. This data is formatted as a value tree which can be used to represent data with an arbitrary structure. The aOptData parameter is typically used to populate large sets of data, for example a treeview, combo list or grid.

Procedure ClientAction String sName String[] aOptParams Variant vActionData

Call: Send ClientAction sName aOptParams vActionData


Send ClientAction to call a function that belongs to the JavaScript object on the client that represents the DataFlex object. Any JavaScript function available on a web object can be called. The ShowInfoBox method is an example of a client action that shows an info box.

Normally you do not need to send ClientAction, as the Web Framework classes wrap these calls into their interface. If you are designing your own JavaScript Web Framework classes, you would use ClientAction to call the interface methods of your JavaScript object and to pass complex data to it.

Note that ClientAction merely queues calls to the JavaScript objects and these requests are only processed when the current server action (e.g. OnClick event) has completed. The action data is passed back to the client in the set of response data that is returned after each successful server action.

Multiple ClientAction calls may be queued during execution of each server action.

ClientActionEx adds a client action to the response that will be executed on the client

ClientActions are executed in order. Only web property changes do not and get processed before client actions. When Web Setting the same property twice during the same call, only the last value is sent to the client and the set_ JavaScript function only gets executed once.

See Building Custom Controls, Communication for an example of how to utilise the ptActionData property.

See Also

ptActionData | serverAction