Local Data Changes
When a scenario modification is completed successfully the server does not issue a data change event to the client that submitted the change.
However, the JavaScript API creates local data change events within your view so that the scenario observers are triggered to update. The way this works changes slightly depending upon which method you use to create the
ScenarioDataChange object:
- Scenario#modify: When completed successfully a change event will trigger other scenario observers listening to any modified entities to fetch the latest data from the server and be called with that data. The observer from which the scenario object originates will NOT be notified of any changes related to this request. It will be your responsibility to make sure the changes are not only committed to the server but also applied to any UI elements managed by this observer.
- View#modifyScenario: When completed successfully a change event will trigger all scenario observers listening to any modified entities to fetch the latest data from the server and be called with that data. You need to be careful not to use this within an observer which you don't want to refresh after the change, use the other method instead. It would cause forms or editable tables to redraw and so possibly lose the user's position or focus.