Skip to main content
Inspiring
September 16, 2009
Question

how do you reference a specific value in a bind value?

  • September 16, 2009
  • 1 reply
  • 874 views

Hi-

I'm working with cfform and am doing binds to cfcs, for example:

<cfinput type="text" name="psistrength" bind="cfc:controller.Controller.getMixPsistrength({mixdesign})" bindattribute="value" bindonload="yes" />

I've listed the cfc's method below. Since my query is returning rows with 4 columns I'd like the freedom to display any of the 4 columns as I need to. Does anyone know how to reference a specific value in:

     ~the cfinput type=text tag, as I described above?

     ~how about if I do a binding from a cfselect value and I want to bind a cfc to a cfgrid, using that cfselect value as the filter for my cfc's method in my bind call?

    <cffunction name="getMixPsistrength"  access="remote" returntype="array" output="yes">
       
        <cfargument name="mixdesign" type="string" required="yes" />
       
        <cfset var qGetMixPsistrength= "" />
        <cfset var qPsi=arrayNew(2) />
        <cfset var j=0>
       
        <cfquery name="qGetMixPsistrength" datasource="#request.DSN#">
            select id, psistrength, colorvalue, pressure
            from concretemixnumbers
            where mixnumber='#ARGUMENTS.mixdesign#'
        </cfquery>
       
        <cfloop from="1" to="#qGetMixPsistrength.recordcount#" index="j">
            <cfset qPsi[1]=qGetMixPsistrength.id/>
            <cfset qPsi[2]=qGetMixPsistrength.psistrength/>

            <cfset qPsi[3]=qGetMixPsistrength.colorvalue/>

            <cfset qPsi[4]=qGetMixPsistrength.pressure/>  
        </cfloop>
       
        <cfreturn qPsi/>
    </cffunction>

Thanks in advance,

Rich

This topic has been closed for replies.

1 reply

October 1, 2009

Call your method via the browser and see what the returned structure is like, then address the required elements via DOM...

Inspiring
October 2, 2009

Thanks, I've been swamped in a huge deadline but I'll give it a try and let you know how it goes.

Thanks again for your input,

Rich