2 Replies Latest reply on Oct 11, 2006 3:09 PM by ntsiii

    data binding in flex form to process equation

    tolson77r
      Hi!
      Essentially I have made an invoice and I am trying to start simple. I can interface flex with php to do the processing but that seems to defeat the speed gains flex offers. What I would like to do is have a textinput field (filled out by the user) and have that fields variable be used in an equation to calculate a total cost. I have been using MXML and have been trying AS3 but am at wits end. I have an example up at http://in49.com/bin/form.html. I would like the Service Call Rate, Hours Worked, Sales Tax and Parts Subtotal added together without a screen refresh. Is this possible? Thanks everyone!

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" backgroundGradientColors="[#CBDCE4, #CBDCE4]" width="100%" height="770">
      <mx:Canvas y="0" width="100%" height="100%" backgroundColor="#CBDCE4">
      <mx:Panel title="Customer Information" layout="vertical" y="10" paddingBottom="10" paddingLeft="10" paddingRight="10" paddingTop="10" height="172" left="10" width="20%">
      <mx:TextInput text="Enter Name"/>
      <mx:TextInput id="address" text="Enter Address"/>
      <mx:TextInput id="other" text="Enter Address"/>
      <mx:TextInput id="phone" text="Enter Phone Number"/>
      </mx:Panel>
      <mx:Panel title="City, State, Zip Code" layout="horizontal" horizontalAlign="left" paddingBottom="10" paddingLeft="10" paddingRight="10" paddingTop="10" y="100" right="10" width="73%">
      <mx:TextInput id="city" text="Enter City"/>
      <mx:TextInput id="state" text="Enter State"/>
      <mx:TextInput id="zip" text="Enter Zip"/>
      </mx:Panel>
      <mx:Panel title="Invoice Information" layout="horizontal" horizontalAlign="left" paddingBottom="10" paddingLeft="10" paddingRight="10" paddingTop="10" y="10" right="10" width="73%">
      <mx:TextInput id="number" text="Invoice Number"/>
      <mx:TextInput id="po" text="Purchase Order"/>
      <mx:DateField width="185"/>
      </mx:Panel>
      <mx:Panel title="Service Call Rate" layout="horizontal" paddingBottom="10" paddingLeft="10" paddingRight="10" paddingTop="10" y="190" left="10" width="50%">
      <mx:TextInput id="servicerate" text="Service Call Rate"/>

      </mx:Panel>
      <mx:RichTextEditor y="190" width="47%" name="Comments" right="10">
      </mx:RichTextEditor>
      <mx:Panel y="280" width="50%" height="210" layout="absolute" title="Materials" left="8">
      <mx:DataGrid x="0" y="0" width="100%" height="170">
      <mx:columns>
      <mx:DataGridColumn headerText="Item" dataField="col1"/>
      <mx:DataGridColumn headerText="Price" dataField="col2"/>
      <mx:DataGridColumn headerText="Quantity" dataField="col3"/>
      </mx:columns>
      </mx:DataGrid>
      </mx:Panel>
      <mx:Panel y="498" height="80" layout="absolute" right="10" left="10">
      <mx:TextInput x="10" y="10" id="parts" text="Parts Subtotal"/>
      <mx:TextInput x="178" y="10" id="tax" text="Sales Tax"/>
      <mx:TextInput x="178" y="10" id="ltotal" text="Labor Total"/>
      <mx:TextInput x="178" y="10" id="rate" text="Initial Rate"/>
      <mx:TextInput x="346" y="10" id="totalFee" text="Total"/>
      <mx:Button x="514" y="10" label="Submit Invoice" width="237"/>
      </mx:Panel>

      </mx:Canvas>
      </mx:Application>