<fx-model>

Description

The model is responsible for:

  • creating and maintaining the Main Dependency Graph (MDG).
  • creating ModelItems for bound data nodes
  • calculation
  • validation

This is done with the help of bind elements.

The <fx-model> element is a direct child of <fx-fore> and is itself a container for:

  • one or more <fx-instance> elements
  • zero, one or more <fx-bind> elements
  • zero, one or more <fx-submission> elements
  • zero, one or more <fx-function> elements

Warning: <fx-model> must be in front of Fore UI elements due to not fully understood Web Components behaviour.

<fx-fore>
    <fx-model>
        <fx-instance><fx-instance>
        <fx-instance id="second"><fx-instance>
        <fx-instance id="third"><fx-instance>
        
        <fx-bind></fx-bind>
        <fx-bind></fx-bind>
        ...
        
        <fx-submission id="load"></fx-submission>
        <fx-submission id="save"></fx-submission>
    </fx-model>
    <!-- UI here -->
</fx-fore>

If there’s more than one <fx-instance> or <fx-submission> you need to add an id attribute for identification.

Attributes

none

Events

EventDescriptionDetails
model-constructfirst event to be emitted by Fore-
model-construct-doneemitted when model has been initialized-
rebuild-donewhen a rebuild has taken place‘maingraph’ - the maingraph object being used
recalculate-donewhen a recalculation has taken place‘subgraph’ - the subgraph object being used