CFselect Code

Hi Experts,
Can you look ta my code I have a CFSelect Bind and for some reason my data is not coming back to my page.  
<!---CFC Page--->
<cfcomponent >
<cffunction name="get_attribute" access="remote" returnType="query">
 <CFQUERY NAME="attribute" DATASOURCE="#application.dsn#">
 SELECT distinct T.EID,
        T.TYPE_CODE,
        T.ATTRIBUTE_LABEL_CODE,
        T.ATTRIBUTE_LABEL_DESCRIPTION
   FROM CSR.CUSTOM_ATTRIBUTES_TEMPLATES T, CSR.ST_CODES C
  WHERE T.ATTRIBUTE_LABEL_CODE IN ('WHATIST2','WHATIST3')
    AND T.ALLOWABLE_GROUP_CODES = 'RIGHTOFW'
    AND T.LOV_TYPE_CODE = C.TYPE_CODE
    AND T.STOP_DATE IS NULL
    AND C.STOP_DATE IS NULL
</CFQUERY>
		<cfreturn attribute>
	</cffunction>
    
	<cffunction name="get_desc" access="remote" returntype="query">
		<cfargument name="ATTRIBUTE_LABEL_CODE">
        <cfquery name="desc" DATASOURCE="#application.dsn#">>
                   SELECT T.EID,
                C.DESCRIPTION,
                T.TYPE_CODE,
                T.ATTRIBUTE_LABEL_CODE,
                T.LOV_TYPE_CODE,
                C.CODE_CODE
           FROM CSR.CUSTOM_ATTRIBUTES_TEMPLATES T, CSR.ST_CODES C
          WHERE T.ALLOWABLE_GROUP_CODES = 'RIGHTOFW'
            AND T.LOV_TYPE_CODE = C.TYPE_CODE
            AND T.STOP_DATE IS NULL
            AND C.STOP_DATE IS NULL
            and T.ATTRIBUTE_LABEL_CODE = #arguments.ATTRIBUTE_LABEL_CODE#
          ORDER BY C.DESCRIPTION ASC
     	</cfquery>
		<cfreturn desc>
	</cffunction>
</cfcomponent> 


<!---form--->
 
  <cfoutput>
    <cfform name="dept_desc" >
      <table  width="" border="0">
        <tr>
          <td >Select Question</td>
          <td><div align="left">
              <!--- First Ajax Control - Auto Bound --->
              <cfselect name="select_attribute"
              bind="cfc:exam1.get_attribute()" 
              display="ATTRIBUTE_LABEL_DESCRIPTION" 
              value="ATTRIBUTE_LABEL_CODE"
              bindonload="true" 
              required="yes" 
              message="Please Select Question"></cfselect> 
          <td>Select Outcome</span></td>
          <td><div align="left">
              <!--- Second Ajax Control - Bound on Selection of Select_Manufacturer--->
              <cfselect 
              name="Select " 
              bind="cfc:exam1.GetSubModules({select_Manufacturer})"
              display="DESCRIPTION" 
              value="ATTRIBUTE_LABEL_CODE " 
              required="yes" 
              message="Please Select Outcome">
              </cfselect> 
            </div></td>
      </table>
      </td>
      </tr>
      </table>
    </cfform>
  </cfoutput>

Open in new window

JeniceMAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

erikTsomikSystem Architect, CF programmer Commented:
I think you are using the wrong form name it should this
<cfoutput>
    <cfform name="dept_desc" >
      <table  width="" border="0">
        <tr>
          <td >Select Question</td>
          <td><div align="left">
              <!--- First Ajax Control - Auto Bound --->
              <cfselect name="select_attribute"
              bind="cfc:exam1.get_attribute()"
              display="ATTRIBUTE_LABEL_DESCRIPTION"
              value="ATTRIBUTE_LABEL_CODE"
              bindonload="true"
              required="yes"
              message="Please Select Question"></cfselect>
          <td>Select Outcome</span></td>
          <td><div align="left">
              <!--- Second Ajax Control - Bound on Selection of Select_Manufacturer--->
              <cfselect
              name="Select " 
              bind="cfc:exam1.GetSubModules({select_attribute})"
              display="DESCRIPTION"
              value="ATTRIBUTE_LABEL_CODE " 
              required="yes"
              message="Please Select Outcome">
              </cfselect>
            </div></td>
      </table>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JeniceMAuthor Commented:
I changed it and the data is still not coming back to my form.

    <cfform name="dept_desc" >
      <table  width="" border="0">
        <tr>
          <td >Select Question</td>
          <td><div align="left">
              <!--- First Ajax Control - Auto Bound --->
              <cfselect name="select_attribute"
              bind="cfc:exam1.get_attribute()"
              display="ATTRIBUTE_LABEL_DESCRIPTION"
              value="ATTRIBUTE_LABEL_CODE"
              bindonload="true"
              required="yes"
              message="Please Select Question"></cfselect>
          <td>Select Outcome</span></td>
          <td><div align="left">
              <!--- Second Ajax Control - Bound on Selection of Select_Manufacturer--->
              <cfselect
              name="Select " 
              bind="cfc:exam1.get_desc({select_attribute})"
              display="DESCRIPTION"
              value="ATTRIBUTE_LABEL_CODE " 
              required="yes"
              message="Please Select Outcome">
              </cfselect>
            </div></td>
      </table>
    </cfform>
  </cfoutput>

0
erikTsomikSystem Architect, CF programmer Commented:
where do you declare the ajax call

<cfajaxproxy

and take a look at this
http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Tags_a-b_3.html
0
OWASP: Avoiding Hacker Tricks

Learn to build secure applications from the mindset of the hacker and avoid being exploited.

JeniceMAuthor Commented:
at the begining of the form. Is this correct? <cfajaxproxy cfc="exam1" jsclassname="exam1">  The .cfc is called "exam1", This is my first time using this.
0
JeniceMAuthor Commented:
I added it and the data still do not come back to the form.
0
_agx_Commented:
First, do your CFC methods work on their own (ie without the ajax part)?  Second, assuming you're not on a shared server, enable the ajax debugging console to get more information.  
http://livedocs.adobe.com/coldfusion/8/htmldocs/ajaxdata_10.html
0
_agx_Commented:
> where do you declare the ajax call
> <cfajaxproxy


    No. You don't need cfajaxproxy for the code you posted.
0
_agx_Commented:
> First, do your CFC methods work on their own

   In other words, test it in steps. (I suspect the problem is in step#1 or #2)

  1. Check the query used by the first cfselect. Does it return data or does an error occur?

        <cfinvoke component="Exam1" method="get_attribute"
            returnvariable="qResults1" />
         <cfdump var="#qResults1#">            

  2. Check the query used by the second cfselect. Does it return data or does an error occur?
         <cfinvoke component="Exam1" method="get_desc"
             ATTRIBUTE_LABEL_CODE="(put in valid value here)"       
             returnvariable="qResults2" />
        <cfdump var="#qResults2#">

   3. If steps #1 and #2 work, then enable the ajax debugging console to get more information
       http://livedocs.adobe.com/coldfusion/8/htmldocs/ajaxdata_10.html
0
JeniceMAuthor Commented:
Thanks for your help but I did something else, I could never get this to work.
0
_agx_Commented:
> Thanks for your help but I did something else, I could never get this to work.

I'm glad you found something that worked.  But just for future reference

1) It's good to try all of the experts suggestions first, and report back on the results.  Based on the image you posted on the duplicate thread, and my tests of your code,  it was likely a simple problem with your CFC that could have been fixed.  Enabling ajax logging probably would have indicated what the issue was ...

2) Try to avoid duplicate questions. I believe there's a 500 pt max on questions at EE

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development Software

From novice to tech pro — start learning today.