0 Replies Latest reply on Aug 12, 2008 1:30 AM by pho3nixx

    Bindable Controls from a Common Base class?

    pho3nixx
      Good Day!

      I am a C#.NET developer working on my first flex project ever using Flex 3, PaperVision3d(GreatWhite - Pretty hard core but very fun) with C# 3.5 (JSON/LINQ2Entities backend). I really enjoy enjoy flex and what it has to offer but I am having difficulty navigating the base types for flex controls.

      My JSON being serialized down from a .NET service, into a basic controller, where I would like to set the 'dataProvider' property of both the ComboBox and ListBox control type instances declared in the MXML component. Although I find this a bit of a pain because I cannot seem to locate a common base type where both have the property defined. The result is lots of plumming to first determine the type, then cast, then assign the Collection. This seems clunky and does not feel right.

      Is there a common base type that I could use in a var to reference most controls with a dataProvider property or is this just something I will have to live with in this version? ie.

      protected virtual function assignListData (control:<Here Is the Common Base Type I am Looking For!>, valueData:Array) : void
      {
      control.dataProvider = valueData;
      }