Child pages
  • Server Side Scripting

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejs
titleclientside service script
$services.callServerSideApi("myservicename","loadRelatedFoundsetForNewTreeNode",[rows[i], 2]).then(function(returnedFoundsetRef) {
   console.log("Related foundset successfully returned...");   
 });


Info
titleModel changes to server

Beware that callServerSideApi does not send outstanding client side model changes to server; this should be handled by sending new values as parameters and modifying model server-side.

Internal API can also be used for API that is defined on client, but can only be called from server side scripting. This API shouldn't be called from Servoy Developer scripting and won't show in code completion.

Calling handlers from server-side js

Since Servoy 8.3 server side scripting also has access to the handlers a developer has assigned in the designer - through $scope.handlers. Together with the new "private": true configuration on a handler definition in the spec file, you can make handlers that are not directly callable from the client but only through server side scripting.

...