# Pragma Form
This is used to crate dynamic form layout using the template parser and dynamic schema / views.

There are three main actions:
 1. Bind to a schema property to define what UI must be shown.
 1. Import schema from file
 1. Export schema to file
 
 ## Fucntions
 The three driving functions that are exposed are:
 
 1. import
 1. export
 1. clear
 
 These represent, import from file, export to file and clear current view so that it shows no UI.
 
 # Basic usage
 
```html
<pragma-form schema.bind="schema" model.bind="model"></pragma-form>
```

The schema defined is the one described in template-parser.
Model is the data to be used.

Pragma form generally will starty rendering the body property of the schema.
If however you want to show only part of the schema you can set the template-id attribute and point to the template in the schema to render.
When you do this it will ignore the body only render the UI in the template definition.

```html
<pragma-form schema.bind="schema" model.bind="model" template-id="0"></pragma-form>
```


When using multiple pragma forms for the same schema but in different UI locations note that for each instance of pragma-form the form update event will fire.
To prevent this you will need to only allow one instance to fire if you use that.
For example:

```js
    formUpdated () {
        if (this._formUpdated == undefined) {
            this._formUpdated = true;

            this.model.setInitialValues({});
            super.formUpdated();
        }
    }
```
