Home > Class Reference > ENSLIB namespace > %ZEN.Component.dynaForm

%ZEN.Component.dynaForm

class %ZEN.Component.dynaForm extends %ZEN.Component.form

A dynaForm (dynamic form) is a specialized type of form that displays form whose controls are drawn automatically based on the contents of dataController associated with the form.
For example:
<dataController id="data" modelClass="ZENMVC.Person"/>
<dynaForm controllerId="data" injectControls="before">
<button caption="Save"/>
</dynaForm>
In this case, a form will be displayed with controls for each of the properties in the class ZENMVC.Person.
It is also possible to use dynaForm without a dataController. In this case you must provide an OnGetPropertyInfo server-side callback method to specify the list of controls to display.

Property Inventory (Including Private)

Method Inventory (Including Private)

Properties (Including Private)

property OnGetPropertyInfo as %ZEN.Datatype.delegator (FORMALSPEC = "pIndex:%Integer,&pInfo:%String,pModelId:%String", RETURNTYPE = "%Status");
(Optional) Name of Server-side callback method called just before dynamic components are injected into this form.
This callback method behaves in much the same way as the %OnGetPropertyInfo() method of the %ZEN.DataModel.ObjectDataModel class. This must be the name of a server-only method in the page class that contains this form component.
For example:
Method GetInfo(pIndex As %Integer,ByRef pInfo As %String,pModelId As %String) As %Status
{
	// subscript of pInfo is the logical name of the control
	// the value of pInfo(name) is the sequence number (ordinal position of the control).
	// the value of pInfo(name,"%type") is the control type to display
	Set pInfo("Field1") = pIndex
	Set pInfo("Field1","%type") = "textarea"
	
	// the value of pInfo(name,"label") is the control label to display
	Set pInfo("Field2") = pIndex + 1
	Set pInfo("Field2","label") = "Field 2"
	Quit $$$OK
}
Property methods: OnGetPropertyInfoDisplayToLogical(), OnGetPropertyInfoGet(), OnGetPropertyInfoIsValid(), OnGetPropertyInfoLogicalToDisplay(), OnGetPropertyInfoLogicalToOdbc(), OnGetPropertyInfoNormalize(), OnGetPropertyInfoSet()
property defaultGroupId as %ZEN.Datatype.id;
If defined, this is the id of a group within this form in which the dynamically created controls will be injected.
Property methods: defaultGroupIdDisplayToLogical(), defaultGroupIdGet(), defaultGroupIdIsValid(), defaultGroupIdLogicalToDisplay(), defaultGroupIdLogicalToOdbc(), defaultGroupIdNormalize(), defaultGroupIdSet()
property injectControls as %ZEN.Datatype.string (VALUELIST = ",before,after") [ InitialExpression = "after" ];
Specifies where in the form the automatically created controls are placed relative to other controls that have been manually placed within the form:
  • "after" - (default) inject the automatically placed controls after any manually placed controls.
  • "before" - inject the automatically placed controls before any manually placed controls.
This is useful for cases where the dynaForm may define buttons and other controls in addition to those that are automatically created.
If defaultGroupId is defined, then this is ignored.
Property methods: injectControlsDisplayToLogical(), injectControlsGet(), injectControlsIsValid(), injectControlsLogicalToDisplay(), injectControlsLogicalToOdbc(), injectControlsNormalize(), injectControlsSet()

Methods (Including Private)

clientmethod setProperty(property, value, value2) [ Language = javascript ]
Set the value of a named property.

Inherited Members

Inherited Properties (Including Private)