Form Tool Wizard

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.

Wizard Markup

The following tags are designed to create custom edit handlers.
To override the default edit handler, you have to create an edit.cfm template in the type webskin folder.

wiz:wizard

  • referenceid; objectid of primary edited object. Lookup to database for object, by profile, by session.

wiz:step
This tag is used to generate a step in a custom edit handler.

Attribute

Description

Value

name

name of the step

String - name of the step

lFields

List of the properties of the type to be displayed/edited in the step

Comma delimited list - (optional)

legend

Header displayed only if lFields is supplied.

String - (optional)

autoGetFields

set to true to get the exact step defined in the metadata (only works if lFields = "")

Boolean - (optional) default to false

how to reproduce an exact step defined in a type metadata

Set the name attribute as the name of the ftwizardStep metadata in your type and set autoGetFields to true.
This is useful when you want to redefine only one step of your edit handler and your type has a lot of properties.

<wiz:step name="ftwizardStep name" autoGetFields="true" />

wiz:object

Very similar to ft:object

  • stobject
  • legend
  • format; edit/display

wiz:processWizard

wiz:processWizardObjects

Sample Implementation

Similar in approach to ft:form.

wizard form structure
<!--- Always save wizard WDDX data --->
<wiz:processwizard excludeAction="Cancel">

	<!--- Save the Primary wizard Object --->
	<wiz:processwizardObjects typename="#stobj.typename#" />

   	<!--- Save any Action Types submitted (including any new ones) --->
   	<wiz:processWizardObjects typename="action">
      		<!--- Do not save the action if their is no title. --->
      		<cfif NOT structKeyExists(stProperties,'title') OR NOT len(stProperties.title)>
         		<wiz:break />
      		</cfif>
	</wiz:processWizardObjects>
</wiz:processwizard>

<wiz:processwizard action="Save" Savewizard="true" Exit="true" /><!--- Save wizard Data to Database and remove wizard --->
<wiz:processwizard action="Cancel" Removewizard="true" Exit="true" /><!--- remove wizard --->


<!--- RENDER THE WIZARD --->
<wiz:wizard ReferenceID="#stobj.objectid#" r_stWizard="stWizard">

   <wiz:step name="Report Details">
      <wiz:object stobject="#stobj#" wizardID="#stWizard.ObjectID#" lfields="title,meetingtime,meetingplace,aContacts,projectid" format="edit" intable="false" legend="Meeting Details" />
      <wiz:object stobject="#stobj#" wizardID="#stWizard.ObjectID#" lfields="description" format="edit" intable="false" legend="Minutes" />
   </wiz:step>
   <wiz:step name="Related content" autoGetFields="true" />
   <wiz:step name="Actions">

      <cfset qActions=getContactReportActions(stobj.objectid) />

      <cfoutput><h3>Current Actions</h3></cfoutput>
      <cfloop query="qActions">
         <wiz:object objectid="#qActions.objectid#" wizardID="#stWizard.ObjectID#" lfields="title" r_stFields="stAction" />
         <cfoutput><div>#stAction.title.html#</div></cfoutput>
      </cfloop>

      <!--- Render 3 new empty actions. Allows adding 3 actions at a time.  --->
      <cfoutput><h3>New Actions Arising</h3></cfoutput>
      <cfloop from="1" to="3" index="i">
         <cfset stDefault=structNew() />
         <cfset stdefault.projectid=stobj.projectid />
         <cfset stdefault.contactreportid=stobj.objectid />
         <wiz:object
            typename="action"
            wizardID="#stWizard.ObjectID#"
            format="edit"
            lfields="title"
            lhiddenfields="projectid,contactreportid"
            bvalidation="false"
            stPropValues="#stDefault#" />

         <cfoutput><hr /></cfoutput>

      </cfloop>

   </wiz:step>
</wiz:wizard>