Observers
Now we have our ScenarioObserver observer object, we need to bind our AutoText component to the HTML node in the markup so that the value of the HelloMessage scalar will be automatically fetched from the server and displayed within our page.
The next line of code achieves this:
.bindAutoText('#hello-message');
This single line of code tells the observer to bind a new AutoText component to the HTML node with the hello-message ID, which registers your element to listen for updates to the HelloMessage scalar by other users, the executing scenario, or other components in the same view.
Finally, the
start method on the view is called:
view.start();
The preceding line is very important: it tells the view to begin fetching data from the server and to start all the observers that react to changes in data and state to which your application will respond.
![]() |
Note If you do not see data appearing in your application views, then check that your code calls
view.start(). Without this code, nothing will happen.
|