Life cycle of the jsRO Objects
Last updated
Last updated
jsRO objects are always defined inside the application and propagated to the browser. New properties, methods or events can't be added From Javascript, but events that are produced can be handled, the property values can be retrieved and modified, and the object's methods can be invoked.
There are four pre-defined Javascript events that are related to the life cycle of a jsRO object, associated to its creation, updating and destruction,
Starting from the first ApplyModel produced in the application, jsRO will create the object, propagate it to the browser and trigger there the event related to this creation:
also, for the properties that are created with an assigned value, jsRO will replicate their initial values in the browser and fire the corresponding events:
and from that moment on, it will keep the state of the properties synchronized in the application and the browser.
If the model needs to be updated by the addition of new attributes (properties, events or method) a new ApplyModel must be made, which will, in turn, with the model already created, fire a changed event on the model:
Finally, if the object is destroyed in the application, the deleted event will be triggered and the object will be destroyed in Javascript too.
This last event will also be triggered when closing the application.
Read more:
· OnPropertyChange(), OnSet() and OnGet() Events