class %ZEN.Component.dynaForm
extends 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 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:
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 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.
method setProperty(property, value, value2)
[ Language = javascript ]
Set the value of a named property.