|Manuals

model

Description

Model is the entry point of the data object tree. It provides access to remote objects that are exposed hierarchically and can be queried by their names.

Syntax

JsRO.model.objectName
JsRO.model.objectName.propertyName
JsRO.model.objectName[index]

Type

Object

Remarks

The model property serves as the root accessor for all remote objects exposed by the HOST application. Objects are organized hierarchically, allowing you to navigate through the object tree using dot notation.

Each object in the model tree can contain:

  • Properties (values that can be read and modified)
  • Child objects (nested objects in the hierarchy)
  • Arrays (indexed collections of objects)

Examples

Accessing a Simple Property

var JsRO = new Thinfinity.JsRO();

// Access a form's title
var formTitle = JsRO.model.Form1.title;
console.log('Form title: ' + formTitle);

Accessing Nested Objects

// Access a checkbox within a form
var checkbox = JsRO.model.Form1.checkBox1;
var isChecked = checkbox.checked;

Accessing Array Elements

// Access items in a list
var firstItem = JsRO.model.Form1.listBox1[0];
var secondItem = JsRO.model.Form1.listBox1[1];

Modifying Values

// Change a text field value
JsRO.model.Form1.textBox1.text = 'New Value';

// Update a checkbox state
JsRO.model.Form1.checkBox1.checked = true;

Complete Example

var JsRO = new Thinfinity.JsRO();

// Wait for connection, then access model
JsRO.on('model:Form1', 'ready', function() {
    // Read form data
    var formData = {
        title: JsRO.model.Form1.title,
        username: JsRO.model.Form1.txtUsername.text,
        remember: JsRO.model.Form1.chkRemember.checked
    };

    console.log('Form data:', formData);
});

See Also