From GeoMedia Smart Client
Jump to: navigation, search
GMSC 2013/2014 Javascript API Overview Form Events Types Utility Functions client-side Validation Conditions Interaction with SmartClient Cookbook Cheatsheet
Form Models BaseModel FormModel TabModel GroupModel Field Models ActionModel

Form API Reference

The IGForm Javascript API allows the manipulation (e.g. show, hide, set value) of form elements like fields, groups and tabs via Javascript. It uses the concept of data binding to keep the form components in sync with a set of javascript objects (models) representing these components in the "scripting space". These bindings work in both directions: if the user types in something in an input field, this input is immediately reflected in the value() property of the corresponding model. If you set the editable() property of a model to false, the bound UI widget doesn't allow inputs any more. You can learn more about the concept of data-binding in the Knockout.js documentation.

Blue.png If you want to manipulate form models before the form has loaded (e.g. in a custom script), you have to subscribe to the onFormReady event and perform your actions in the event callback.

the different form models in a rendered form

Anatomy of a form

We provide five types of form models for all form items.

  • The form its self ( IG.FormModel)
  • The form tabs (IG.TabModel) which contains the form tab strips
  • The form tab strips (IG.TabStripModel) which contains the form groups
  • The form groups ( IG.GroupModel) which contains the form singlerows and the form fields
  • The form singlerows (IG.SingleRowModel) which contains the form fields
  • The form fields ( IG.FieldModels). The form fields are subdived into different form fieldmodels depending on its user interface widget (for example IG.FieldModels.TextField or IG.FieldModels.Grid)
  • Any type (e.g. actions for a field, actions for a group or actions for the form) of an action in a form ( IG.ActionModel). All other models are containing a list of actions.