ColdFusion 9.0 Resources |
Data modelThe XForms data model specifies the data that the form submits. It includes information on each displayed control that can submit data, including initial values and validation information. It does not contain information about cfformgroup or cfformitem tags. The data model consists of the following elements and their children:
xf:instance elementThe XForms xf:instance element contains information about the form data controls. Any control that can submit data has a corresponding instance element. If the control has an initial value, the instance element contains that value. The xf:instance element contains a single cf:data element that contains an element for each data control: cfgrid, most cfinput tag types, cfselect, cfslider, cftextarea, and cftree. Each element name is the corresponding CFML tag’s name attribute. For applet and Flash format cfgrid and cftree tags, the element name is the value of the cf_param_name parameter of the tree or grid’s Java applet object. Only cfinput tags of types submit, image, reset, andbutton do not have instance data, because they cannot submit data. The body of each element contains the initial control data from the CFML tag’s value attribute or its equivalent. For example, for a cfselect tag, the xf:instance element body is a comma-delimited list that contains the name attributes of all the option tags with a selected attribute. For submit and image buttons, the body contains the name attribute value. The following example shows the xf:instance element for the form shown in the image in About XML skinnable forms: <xf:instance> <cf:data> <firstname/> <lastname/> <email/> <revision>Comment Form revision 12a</revision> <satisfaction>very satisfied</satisfaction> <thoughts>We really want to hear from you!</thoughts> </cf:data> </xf:instance> xf:submission elementThe xf:submission element specifies the action when the form is submitted, and contains the values of the cfformaction and method attributes.: The following example shows the XML for the form shown in the image in About XML skinnable forms: <xf:submission action="/_MyStuff/phase1/forms/XForms/FrameExamples/Figure1.cfm" method="post"/> xf:bind elementsThe xf:bind elements provide information about the input control behavior, including the control type and any data validation rules. The XML has one bind element for each instance element that can submit data. It does not have bind elements for controls such as cfformitem tags, or cfinput tags with submit, input, reset, or image types. Each element has the following attributes:
Each xf:bind element has an xf:extension element with ColdFusion specific information, including type and validation values. The following table lists the cf namespace elements that are used here.
The following example shows the xf:bind element of the form shown in the image in About XML skinnable forms: <xf:bind id="firstname" nodeset="//xf:model/xf:instance/cf:data/firstname" required="true()"> <xf:extension> <cf:attribute name="type">TEXT</cf:attribute> <cf:attribute name="onerror">_CF_onError</cf:attribute> </xf:extension> </xf:bind> <xf:bind id="lastname" nodeset="//xf:model/xf:instance/cf:data/lastname" required="true()"> <xf:extension> <cf:attribute name="type">TEXT</cf:attribute> <cf:attribute name="onerror">_CF_onError</cf:attribute> </xf:extension> </xf:bind> <xf:bind id="email" nodeset="//xf:model/xf:instance/cf:data/email" required="false()"> <xf:extension> <cf:attribute name="type">TEXT</cf:attribute> <cf:attribute name="onerror">_CF_onError</cf:attribute> </xf:extension> </xf:bind> <xf:bind id="satisfaction" nodeset="//xf:model/xf:instance/cf:data/satisfaction" required="false()"> <xf:extension> <cf:attribute name="type">SELECT</cf:attribute> <cf:attribute name="onerror">_CF_onError</cf:attribute> </xf:extension> </xf:bind> <xf:bind id="thoughts" nodeset="//xf:model/xf:instance/cf:data/thoughts" required="false()"> <xf:extension> <cf:attribute name="type">TEXT</cf:attribute> <cf:attribute name="onerror">_CF_onError</cf:attribute> </xf:extension> </xf:bind> |