0

I'm trying to bind the following code to a cfselect, and call a cffunction within a cfc.

<cfset qry_student = #getUsersForMassEmail('S',session.termcode,{cmbCRN@change})#>

My problem is with {cmbCRN@change}, which is giving me the following output:

Invalid construct: Either argument or name is missing.

Any idea of what I'm missing?

Fish Below the Ice
  • 1,273
  • 13
  • 23
  • 1
    For starters..stop using `cfselect` and any other UI elements that are part of ColdFusion. They are poorly implemented and limited in functionality. Use plain old `select` and a JavaScript library such as jQuery to learn how to do it the correct way. – Scott Stroz Sep 24 '14 at 03:15
  • Thanks for your participation Matt and Scott. My problem is with the token @change. "Invalid token @". That's what I'm looking for, to use the token within the function. Right now I'm working to retrieve the data with cfml2js, however, I would like to know the correct way to use the token. Thanks again – David Dos Santos Sep 24 '14 at 03:38

1 Answers1

1

As others have said, using cfselect and bindings like this is not recommended, but, I'll answer anyway. The binding for CF UI stuff are for client side code. Ie, I can specify a UI item and say, when another UI item changes, change me too. You are trying to bind to a cfselect from a local variable. If you think about it, that variable won't exist in the client side code - it is just CF code. You just can't do that.

Raymond Camden
  • 10,661
  • 3
  • 34
  • 68
  • Thanks Raymond for your advise. Let's switch to a select then. Do you have a reference where I can take a look to bind a select to a cffunction instead? (I'm aware about the client/server interaction), and for that reason I'm coding with cfml2js. Resume: I have a select, when a change occur within the select, it has to call the cffunction. Thanks again. – David Dos Santos Sep 24 '14 at 12:56
  • You can run JS code when the cfselect changes, and *that* JS code can call a CFC. Look at the docs for cfajaxproxy for an example. – Raymond Camden Sep 24 '14 at 14:23
  • 2
    But to be clear, if you have just begun this work, I urge you to stop. http://static.raymondcamden.com/cfuitherightway/ – Raymond Camden Sep 24 '14 at 14:24