Link to home
Start Free TrialLog in
Avatar of JeniceM
JeniceM

asked on

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

ASKER CERTIFIED SOLUTION
Avatar of erikTsomik
erikTsomik
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JeniceM
JeniceM

ASKER

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>

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JeniceM

ASKER

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.
Avatar of JeniceM

ASKER

I added it and the data still do not come back to the form.
SOLUTION
Avatar of _agx_
_agx_
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JeniceM

ASKER

Thanks for your help but I did something else, I could never get this to work.
> 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