Form Tool Usage
Documentation Incomplete
These are notes during the beta cycle only and are not complete – examples may not reflect best practice with respect to the final release of the 4.0 code base.
ft:object
stobject
lfields
lhiddenfields
helptitle
helpsection
legend
format; edit, display
inTable: default; true. Options; true/false.
includelabel: default; true. Options; true/false.
r_stFields; returns structure of field metadata, values and labels.
ft:processForm
Action
ftprocessFormObjects
typename
ft:facrybutton
value
<cfsetting enablecfoutputonly="yes">
<cfimport taglib="/farcry/core/tags/formtools/" prefix="ft" >
<cfoutput><h2>Support Edit Handler</h2></cfoutput>
<ft:form>
<ft:object stObject="#stObj#" lFields="Title,Description,supportType,StartDate,EndDate,aDocuments" format="edit" />
</ft:form>
<cfsetting enablecfoutputonly="no">
<cfsetting enablecfoutputonly="yes">
<cfimport taglib="/farcry/core/tags/formtools/" prefix="ft" >
<cfoutput><h2>Support Edit Handler</h2></cfoutput>
<ft:form>
<ft:object stObject="#stObj#" Legend="General" lFields="Title,Description,supportType,StartDate,EndDate" format="edit" />
<ft:object stObject="#stObj#" Legend="Links" lFields="aDocuments,aDaemonContact,aClientContact" format="edit" />
</ft:form>
<cfsetting enablecfoutputonly="no">
<cfsetting enablecfoutputonly="yes">
<cfimport taglib="/farcry/core/tags/formtools/" prefix="ft" >
<ft:processForm Action="Save">
<ft:processFormObjects typename="dm Support" />
</ft:processForm>
<cfoutput><h2>Editing #stObj.Label#</h2></cfoutput>
<ft:form>
<ft:object stObject="#stObj#" Legend="General" lFields="Title,Description,supportType,StartDate,EndDate" format="edit" HelpTitle="General Details" HelpSection="Put in the general details of this Support Contract." />
<ft:object stObject="#stObj#" Legend="Links" lFields="aDocuments,aDaemonContact,aClientContact,AccountID" format="edit" HelpTitle="Information" HelpSection="Other information."/>
<ft:farcrybutton value="Save" />
<ft:farcrybutton value="Cancel" />
</ft:form>
<cfsetting enablecfoutputonly="no">
<cfimport prefix="ft" taglib="/farcry/core/tags/formtools" />
<!-------------------------------
ACTION:
-------------------------------->
<ft:processform action="Save">
<!--- process action items --->
<ft:processformobjects typename="crmTodo">
<cfif NOT len(stproperties.title)>
<ft:break />
</cfif>
</ft:processformobjects>
<!--- rename return list (as it will be overwritten in the next processformobjects) --->
<cfset ltodos=lsavedobjectids />
<!--- primary content item --->
<ft:processformobjects typename="crmContactReport">
<!--- update action item refs in contact report --->
<cfset stproperties.aActions=listtoarray(ltodos) />
</ft:processformobjects>
</ft:processform>
<!-------------------------------
VIEW:
-------------------------------->
<ft:form>
<ft:object stobject="#stFlowobj#" lfields="title,meetingtime,meetingplace,aContacts,projectid" format="edit" intable="false" legend="Meeting Details" />
<ft:object stobject="#stFlowobj#" lfields="description" format="edit" intable="false" legend="Minutes" />
<ft:object stobject="#stFlowobj#" lfields="aActions" format="edit" intable="false" legend="Actions">
<cfoutput><h3>New Actions Arising</h3></cfoutput>
<cfloop from="1" to="3" index="i">
<ft:object typename="crmTodo" format="edit" lfields="title,description,aActionBy" intable="false" includefieldset="false" />
<cfoutput><hr style="border: solid 1px black; width: 90%;" /></cfoutput>
</cfloop>
</ft:object>
<ft:farcrybutton value="Save" />
<ft:farcrybutton value="Cancel" />
</ft:form>