Calling model functions

In addition to the ability to display attribute values on your custom web pages, you can add to web pages the ability to call functions in your model.

Procedure

To allow a web page to call a function from your model, make the following changes to the page:

  1. Declare a new variable as a WebObject.
  2. Call the bind function, providing the variable name and the name of the function from your model as parameters.
  3. Add a link or other control to call the set() function for the new variable.

Results

The following code snippets reflect these steps:

<script>
var play = new WebObject;
bind(window.play, 'CDPlayer[0]::playCD');
</script>
<p><a href="javascript:play.set();"></a></p>

In this example, CDPLayer[0] represents the relevant object in the model, and playCD is the name of the operation that is to be called.

Browser showing operations

Feedback