Put this in your action script in your onLoad function. It will work as the labelFunction property of the mx.controls.ComboBox allows you to supply your own function for rendering the label.

function formOnLoad() : String {
   mySelect.labelFunction = function(item : Object) : Void {
      return (item.provider + item.providerLocation);
   }
}

Note that the item argument that it receives is the row from the data provider (your query) of the item bieng rendered. So all the columns in your query should show up there.

Hug tightly to this page as it is incredibly handy for flash forms.
http://livedocs.macromedia.com/flex/15/asdocs_en/

Good Luck,
Mike

On 6/6/06, Christopher Jordan <[EMAIL PROTECTED]> wrote:
Ray,

I've done that sort of thing, but not using CFFormGroup, or CFSelect. I typically use normal HTML form and select tags using ColdFusion to build the HTML for me if I need to... perhaps something like:

<select Name="MySelect">
    <CFLoop query="getAllProviders">
       <CFSet ThisProvider = Trim(getAllProviders.Provider) & " " & Trim(getAllProviders.ProviderLocation)>
       <option value="999999999">#ThisProvider#</option>
    </CFLoop>
</select>

Whether or not the option is pre-selected can be handled as well.

Would something like this work for you?

Chris


Ray Hughes wrote:
Hi All

I have a piece of code that works which I built. Now I want to extend it
such that the value field is a concatenated value of two fields from the database.

Working part:
<cfformgroup type="page" label="Provider">
    <cfselect name="Provider" label="Provider:" query="getAllProviders"
        queryPosition="below" display="Provider" value="ProviderLocation">
        <option value="9999999999" selected>Any Provider</option>
    </cfselect>
</cfformgroup>

This is the same:
<cfformgroup type="page" label="Provider">
    <cfselect name="Provider" label="Provider:" query="getAllProviders"
        queryPosition="below"


This display function I want to extend.
I want to display the concatenated value of two fields from the database.
display="Provider & ProviderLocation"


This is the same:
value="ProviderLocation">
        <option value="9999999999" selected>Any Provider</option>
    </cfselect>
</cfformgroup>

Has anyone attempted to do this before?

This is the error I receive. I have tried several different combination.

Query column invalid or missing.
You must specify the name of a column in the query "getAllProviders" for the Display attribute of the CFSelect tag.

Regards

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar – get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/


_______________________________________________
Reply to DFWCFUG:  [email protected]
Subscribe/Unsubscribe:  http://lists1.safesecureweb.com/mailman/listinfo/list
List Archives:    http://www.mail-archive.com/list%40list.dfwcfug.org/              http://www.mail-archive.com/list%40dfwcfug.org/
DFWCFUG Sponsors:  www.HostMySite.com   www.teksystems.com/



_______________________________________________
Reply to DFWCFUG:
 [email protected]
Subscribe/Unsubscribe:
 http://lists1.safesecureweb.com/mailman/listinfo/list
List Archives:
    http://www.mail-archive.com/list%40list.dfwcfug.org/
  http://www.mail-archive.com/list%40dfwcfug.org/
DFWCFUG Sponsors:
 www.HostMySite.com
  www.teksystems.com/





--
Mike Kelp

--Education's purpose is to replace an empty mind with an open one.
~Malcolm S. Forbes
--If knowledge is power, know this is tyranny.
~Thrice
_______________________________________________
Reply to DFWCFUG: 
  [email protected]
Subscribe/Unsubscribe: 
  http://lists1.safesecureweb.com/mailman/listinfo/list
List Archives: 
    http://www.mail-archive.com/list%40list.dfwcfug.org/             
  http://www.mail-archive.com/list%40dfwcfug.org/
DFWCFUG Sponsors: 
  www.HostMySite.com 
  www.teksystems.com/

Reply via email to