0 Replies Latest reply on May 26, 2009 10:38 PM by WestSide

    Dynamic <mx:Label> problem...

    WestSide Level 1



      I have the following code.  I am populating this custom combo box control and it works fine as it stands, but I need to handle an additional object type and the way my code is written is uses a ternary operator so I can handle a third object type.  So where you see Customer ( data ) and Employee ( data ), I would like to add another type here but I'm unsure how to do it.  Basically appModel.searchResults currently contains 2 types of objects, there is a third object I would like to have.


      Code below:



      <!-- Search Component -->





      <controls:CustomAutoComplete id="searchInput" width="234" height="22

      " typedTextChange="onTypeTextChanged()"



      { appModel.searchResults }" lookAhead="false" styleName="searchInput" labelField="displayName"















           <mx:Label text="{ data is Customer? Customer( data ).displayName : Employee( data ).displayName }">








      import com.app.model.Customer;





      import com.app.model.Employee;