Packageat.datacollection
Classpublic class DataItemForm
InheritanceDataItemForm Inheritance DataItemGeneric



Public Properties
 PropertyDefined by
 InheritedbookEnd : BookEndRow
The Book End for this data collection element per the IDataItem implementation
DataItemGeneric
 InheritedbookEndTime : Date
Internal variable to store the Book End date for this item.
DataItemGeneric
 InheritedbookStart : BookStartRow
The Book Start for this data collection element per the IDataItem implementation
DataItemGeneric
 InheritedbookStartTime : Date
Internal variable to store the Book Start date for this item.
DataItemGeneric
 InheriteddataWorkerOptions : uint
An unsigned integer (uint) that disables various elements of the data collection to be stored into the database
DataItemGeneric
 InheritedendEvent : String
The event that will dispatch signaling the end of data collection of the generic item.
DataItemGeneric
 InheritedfriendlyName : String
A human readable name for your generic item
DataItemGeneric
  itemType : String
[read-only]
DataItemForm
 Inheritedproperties : Array
An array of string that correlate to public properties of the Target object.
DataItemGeneric
  questionBank : Array
Internal collection of question answer pairs
DataItemForm
 InheritedremoveOnEndEvent : Boolean
A boolean to tell the data item worker to remove it from it's internal list once it has been pushed to the database.
DataItemGeneric
 InheritedstartEvent : String
The event that will dispatch signaling the beginning of data collection
DataItemGeneric
 Inheritedtarget : *
This will be the object responsible for providing values for the properties and dispatching the begin and end data collection events.
DataItemGeneric
Public Methods
 MethodDefined by
  
DataItemForm(target:*, nameOfForm:String, dataWorkerOptions:uint)
This method enable data collection of Forms, Quizes and Surveys.
DataItemForm
 Inherited
addBookEndSlotData(args:Array):void
Pushes an array of data to be stored into the data collection database.
DataItemGeneric
 Inherited
addBookEndSlotDataSingle(args:Array):void
Similar to the addBookEndSlotData it will add data to the data slots, however, it will store an unlimited amount to the database.
DataItemGeneric
 Inherited
addBookStartSlotData(args:Array):void
Pushes an array of data to be stored into the DataCollection database.
DataItemGeneric
 Inherited
addBookStartSlotDataSingle(args:Array):void
Similar to the addBookStartSlotData it will add data to the data slots, however, it will store an unlimited amount to the database.
DataItemGeneric
  
addCheckBox(question:String, target:*):void
This method will collect data on input from a CheckBox control.
DataItemForm
  
addComboBox(question:String, target:*):void
This method will collect data on the input from a ComboxBox control.
DataItemForm
  
addCustomItem(question:String, target:String, pProperty:*):void
This method will collect data on the input from a custom class or control.
DataItemForm
  
addCustomItemMulti(question:String, targets:Array, property:String, labelProperty:String):void
This method will collect data on input from an array of custom classes or controls.
DataItemForm
  
addLabel(question:String, target:*):void
This method will collect data on input that is supplied to a Label control.
DataItemForm
  
addMultipleCheckBoxes(question:String, targets:Array):void
Allows adding a goup of related checkboxes
DataItemForm
  
addRadioGroup(question:String, target:*):void
This method will collect data on the input from a RadioButtonGroup.
DataItemForm
  
addTextArea(question:String, target:*):void
This method will collect data on input that is supplied to a TextArea field.
DataItemForm
  
addTextInput(question:String, target:*):void
This method will collect data on input that is supplied to a TextInput field.
DataItemForm
  
addTextResult(question:String, target:*):void
This method will collect data on an object that contains a "text" property.
DataItemForm
Property detail
itemTypeproperty
itemType:String  [read-only]Implementation
    public function get itemType():String
questionBankproperty 
questionBank:Array  [read-write]

Internal collection of question answer pairs

Implementation
    public function get questionBank():Array
    public function set questionBank(value:Array):void
Constructor detail
DataItemForm()constructor
public function DataItemForm(target:*, nameOfForm:String, dataWorkerOptions:uint)

This method enable data collection of Forms, Quizes and Surveys. This can either be set up within Flex as a component or from a Flash project. From Flex it is recommended that you declare this DataCollection item in the initalize event. However, it may be declared elsewhere in your project as long as it is added to the DataCollection module before the DATA_FORM_START event is dispatched from the target object. From Flash it is recommended that you declare this DataCollection item within the constructor of the document class. You may also declare this item in the timeline as long as it is added to the DataCollection module before the DATA_FORM_START event is dispatched from the target object. Please see all helper methods within this class to add Data elements to the form.

Parameters
target:* — The object (usually the object containing the form controls) that will dispatch the data form "start" and "end" events.
 
nameOfForm:String — A friendly name for the form.
 
dataWorkerOptions:uint — Any data worker options that you would like disabled.

Example
   <?xml version="1.0" encoding="utf-8"?>
   <mx:Canvas 
    xmlns:mx="http://www.adobe.com/2006/mxml" 
    creationPolicy="all" 
    initialize="init()" 
    addedToStage="beginForm()">
    <mx:Script>
     <![CDATA[
      import at.datacollection.workers.DataWorkerForm;
      import at.datacollection.DataCollectionModule;
      import at.datacollection.workers.DataWorkerOptions;
      import at.datacollection.DataItemForm;
      private var tif:DataItemForm;
      private function init():void{
       tif = new DataItemForm(this,"Sample Form",DataWorkerOptions.USE_DEFAULTS);
       tif.addTextInput("First Name",this.first_name);
       DataCollectionModule.addDataCollectionItem(tif);
      }
      private function beginForm():void{
       //start this form
       this.dispatchEvent(new Event(DataWorkerForm.DATA_FORM_START));
      }
      private function onSubmitHandler(e:Event):void{
       //end this form
       this.dispatchEvent(new Event(DataWorkerForm.DATA_FORM_END));
      }
     ]]>
    </mx:Script>
    <mx:TextInput id="first_name" />
    <mx:Button id="submit" click="onSubmitHandler(event)" />
   </mx:Canvas>
   

Method detail
addCheckBox()method
public function addCheckBox(question:String, target:*):void

This method will collect data on input from a CheckBox control. If checked, the value stored is "true". If un-checke, the value stored if "false".

Parameters
question:String — The question that relates to the object being data collected.
 
target:* — The object that contains the answer that is going to be stored into the database.
addComboBox()method 
public function addComboBox(question:String, target:*):void

This method will collect data on the input from a ComboxBox control.

Parameters
question:String — The question that relates to the object being data collected.
 
target:* — The object that contains the answer that is going to be stored into the database.
addCustomItem()method 
public function addCustomItem(question:String, target:String, pProperty:*):void

This method will collect data on the input from a custom class or control. You still need to supply the question and target object as in the other functions, the only difference is you need to supply the property from the target you wish to store in the database. Example: You have a custom control called "myCtl" and it contains a property called "selectedValue". To collect data from myCtl.selectedValue: addCustomItem("My Controls Says",myCtl,"selectedValue");

Parameters
question:String — The question that relates to the object being data collected.
 
target:String — The object that contains the answer that is going to be stored into the database.
 
pProperty:* — The name of the property to extract the value.
addCustomItemMulti()method 
public function addCustomItemMulti(question:String, targets:Array, property:String, labelProperty:String):void

This method will collect data on input from an array of custom classes or controls. This method is very similar to the addCustomItem(...) method except that it will store the values from a collection of targets. Example: var obj1:Object = {x:0}; var obj2:Object = {x:1); var obj3:Object = {x:13}; var arr:Array = [obj1,obj2,obj3]; tif = new DataItemForm(this,"Sample Form",DataWorkerOptions.USE_DEFAULTS); tif.addCustomItemMulti("Multi Question",arr,"x"); When the End Form event is called the Data Item Worker will iterate over each object in the array and extract the value for "x". In this example in the end slot data you would see the values of 0,1 and 13.

Parameters
question:String — The question that relates to the object being data collected.
 
targets:Array — The array of objects that contains the answers that are going to be stored into the database.
 
property:String — The name of the property to extract the value.
 
labelProperty:String — The property of the target that will supply the label
addLabel()method 
public function addLabel(question:String, target:*):void

This method will collect data on input that is supplied to a Label control. This would be helpful if you had generated text from a form that you do not want users to edit.

Parameters
question:String — The question that relates to the object being data collected.
 
target:* — The object that contains the answer that is going to be stored into the database.
addMultipleCheckBoxes()method 
public function addMultipleCheckBoxes(question:String, targets:Array):void

Allows adding a goup of related checkboxes

Parameters
question:String
 
targets:Array
addRadioGroup()method 
public function addRadioGroup(question:String, target:*):void

This method will collect data on the input from a RadioButtonGroup.

Parameters
question:String — The question that relates to the object being data collected.
 
target:* — The object that contains the answer that is going to be stored into the database.
addTextArea()method 
public function addTextArea(question:String, target:*):void

This method will collect data on input that is supplied to a TextArea field.

Parameters
question:String — The question that relates to the object being data collected.
 
target:* — The object that contains the answer that is going to be stored into the database.
addTextInput()method 
public function addTextInput(question:String, target:*):void

This method will collect data on input that is supplied to a TextInput field.

Parameters
question:String — The question that relates to the object being data collected.
 
target:* — The object that contains the answer that is going to be stored into the database.
addTextResult()method 
public function addTextResult(question:String, target:*):void

This method will collect data on an object that contains a "text" property.

Parameters
question:String — The question that relates to the object being data collected.
 
target:* — The object that contains the answer that is going to be stored into the database.