1 Reply Latest reply on Mar 28, 2009 12:06 PM by John Hall

    combobox problem

    jason_y Level 1

      I have a <mx:combobox> whick receives data from the database (via remoteobject). It would then generate an HTML-type drop-down with an ID for the "value" and some text (in this case, states) for what the user sees in the drop-down. I am able to get the latter displayed, but I couldn't get the ID "value". I was wondering if there is an easy way to do this?

      The query I have is and I want to put "Provincestate_Id" as the value and "Provincestate_Name" as what the user sees:
      SELECT Provincestate_Id,
      FROM Provincestate
      ORDER BY Provincestate_Name


        • 1. Re: combobox problem
          John Hall Level 4
          From the snippet and no test data to try, I would guess you want a label function. I assume you're looping over the array. So instead of labelField, try labelFieldFunction. Something along the lines of (untested):

          labelFieldFunction ="getStateName" />

          In script block, something like:
          private function getStateName(o:Object):String {
          return o.Provincestate_Name;