Initializing help system before first use

AutoText

To provide a bit more detail on what is happening in the example, look more closely at the AutoText component.

There are two code snippets specified in the creation of the AutoText component:

HTML
<h1 id="hello-message" data-entity="HelloMessage"></h1>
JavaScript
observer.bindAutoText('#hello-message');

The HTML declaration can be any type of HTML that allows the display of text in the page. Two attributes: id and data-entity have been added.

The id ensures that the bindAutoText call can locate where in the DOM (HTML Document Object Model, which is the structure of the web page as described by the HTML markup) is to attach the necessary code that displays the value of the scalar. Each id used in the HTML markup must be unique to this view; that is, you must not have another HTML element with the same id.

The data-entity attribute tells the AutoText component which entity in the Mosel model we want to observe. Be sure to use the entity name and not its alias.

The call to bindAutoText on the ScenarioObserver then sets up the association with the specified ID so that it is ready for the view.start() call to start the process of pulling data into the component.

These two lines of JavaScript code and HTML hook into the system that takes care of the details that are important for the proper running of your application. This includes reacting to changes in the state of the Mosel model and propagating the changes made by one user to all other users of the application.

© 2001-2019 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.