4 Replies Latest reply on Dec 17, 2007 9:11 PM by Zolotoj

    Form data question

    Zolotoj Level 3
      What is a best way of attaching data to a form? With other controls (DataGrid) it's simple because it has a dataProvider concept. But the form does not have it. Can someone recommend a pattern to design a form data?

      Thanks
        • 1. Re: Form data question
          atta707 Level 2
          1) Simple binding with [Bindable] members
          2) DataModel class.
          • 2. Re: Form data question
            Zolotoj Level 3
            But how would I assign data to each control in a form?
            • 3. Re: Form data question
              bitwyse Level 1
              It's not that hard really . . . For example, I have a web service that fetches data from my database and stores the results in an object. From there I pull the values and update my form fields.

              _projectDetail contains data from my web service . . . .
              Populate labels and data fields in a table like fashion using Grid and GridItem. Use { } to pull data from bindable values so they update on the screen when ever the data changes.

              <mx:Grid label="{_projectDetail.projectID}-{_projectDetail.projectName} - Status: {_projectDetail.projectStatus}" width="100%">
              <mx:GridRow>
              <mx:GridItem>
              <mx:Label text="Company"/>
              </mx:GridItem>
              <mx:GridItem>
              <mx:Text text="{_projectDetail.projectCompanyName}"/>
              </mx:GridItem>
              </mx:GridRow>
              </mx:Grid>
              • 4. Re: Form data question
                Zolotoj Level 3
                Not sure I understand how that is related to a form question.