• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

ajax cfc issue -- indeterminent error msg

Participant ,
Aug 13, 2010 Aug 13, 2010

Copy link to clipboard

Copied

I have one ajax cfc app that works fine.  This app uses the file name from the browse button on the file input object that is passed to my proxy.cfc, which in turn, queries the attachments table in my db to see if this file has already been uploaded for this project.  If the file is not there, then I upload it to the server.  If it is there, I pop-up an error message to the user giving him/her the date/time it was uploaded and by whom.  These values are returned by testing code in the cfc.   It works great.

I am now working on another app that will populate a lower-order select box in a hierarchy of select boxes based upon the new value in the current select box that has just been selected.  It seems doable, but there is an immediate error that I cannot seem to get past an error thrown by the IE error handler as an unhandled error.  This error is a “throw msg” error within the core Adobe code, which I’ve pasted in below:

throw_msg.jpg

I have modeled the new app after the one that I have working.  In a effort to figure out this cause of this problem, I have even housed it in the original proxy.cfc to eliminate any question about having it in the correct location on the server. 

At the current point, I am only trying to return an input value from the app, getAreasRmt.  Here are the calling and called code.  The line in the calling code that generates the error is the one where I call the cfc function: “alert (‘Rtnd BuGrpID: ‘ + areaProxy.getAreasRmt(….)));”

Calling JS:

CallingJS.jpg

getAreasRmt:

     This code will eventually pass back a structure containing all of the areas whose Business Group ID is sBuGrpID. 

     apsAreasRmt.jpg

     I am running CF8 on a W2003 x64 server with IIS 6.0.

     Thanks in advance for any help/suggestioins.

:-}

Len

TOPICS
Advanced techniques

Views

1.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 17, 2010 Aug 17, 2010

Copy link to clipboard

Copied

Folks,

This is my first attempt to bind a CFC to a <cfselect> so I may be missing something very basic that everyone elses knows.

I've made some progress on this issue, but I'm not sure I'm actually moving forward.   After Googling, reviewing CF8 books and searching this site, I have converted this over to binding my CFC to a <cfselect>, which then calls the procedure within the cfc.  I've also started using cfdebug and FireBug from time to time to try to gain some insight into what is happening.

But I think that I'm just at a different form of the original error message.  Here is the error from the Ajax Debug Log window:

window:global: Exception thrown and not caught (http://192.168.1.100/CFIDE/scripts/ajax/package/cfajax.js, line 798) [Note: 798 could be the loction of the original error.  Or not]

info:http: CFC invocation response:{"COLUMNS":["LOCATIONNAME","LOCATIONID"],"DATA":[["CDPG BOARDS",1],["CDPG Boxed Processor",12],["DIJIC",13],["EPSD BOARDS",2],["EPSD SYSTEM",3],["KM-RDV",4],["LAD",5],["MCPD",6],["MWG",7],["New BOARDS",9],["NEW_BIZ-RDV",11],["NPG",10],["OPD",8],["TestBus",14],["Testing ",15]]}

info:http: HTTP GET /PHREDsevenInternal/Templates/hierchy.cfc?method=getLocs&returnFormat=json&argumentCollection=%7B%7D&_cf_nodebug=true&_cf_nocache=true&_cf_clientid=999030C7709D5E20E12A17ED431EFB2A&_cf_rc=0

info:http: Invoking CFC: /PHREDsevenInternal/Templates/hierchy.cfc , function: getLocs , arguments: {}

info:LogReader: LogReader initialized

info:global: Logger initialized.

It is returning the query from the CFC finally. I'm assuming that if there would not have been an error, then the query would have been loaded into the <cfselect> that called it.

Here is the latest version of both sides of the cfc binding:

Call side:

<cfselect bind="CFC:hierchy.getLocs()" bindonload="true" value="LocationID" display="LocationName" name="Location" />

Here is the CFC code:

<cfcomponent output="false">

<!--- Test to see if the passed-in name is in the db already --->
<cffunction name="getLocs" access="remote" returntype="query">
  <cftry>
    <cfquery name="getLocQry" datasource="PHREDsevenInternalSQL">
     SELECT LocationName,LocationID
     FROM Locations
     ORDER BY LocationName
    </cfquery>
    <cfcatch type="Any">
     <cfdump var="#getLocQry#">
    </cfcatch>
  </cftry>
  <cfreturn getLocQry>
</cffunction>

</cfcomponent>

Question about location of the CFC.  I prefer to keep all my CFC's in a CFC directory so that they can be reuseable.  I tried both relative and full location methods but neither worked.  If it didn't find the CFC, then it would throw an error telling me that it didn't find it, but I could not get the query to run and return the info you see above until I moved it into the directory where the calling cfm lives.  Is there some mystical/magically method for letting CF know where it is if it isn't in the invoking directory?  I know that if I were invoking a CFC that I would have to use the full path dotted method.   I actually did that here but it didn't get me a result back.  It just told me that I needed to return a 2D arrary or serialized query, which told me that I wasn't actually running the query even though CF could not find it.  Or I think that is what it meant.

I'm at a total loss as how to proceed.  I've spent 4 days on this now and need to get this issue resolved.

Thanks again for any suggestions/help on this matter.

:-}

Len

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 17, 2010 Aug 17, 2010

Copy link to clipboard

Copied

There is a setting on the admin page that lets you specify a home for all cfc's on the server.  The other way is to put them in the directory from which they are called, or anything upwards in the path.  Then, when you call it, it should just work.  Don't put in any addressing.

Alternatively, if you are not dealing with huge amounts of data, you can accomplish the same thing with straight javascript.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 17, 2010 Aug 17, 2010

Copy link to clipboard

Copied

LATEST

Dan,

     Thanks for the mapping answer.  I can now map the CFC from where I want to, but I'm still getting the same error.

     I am using the new method to replace the WDDX/JavaScript method that I have been using for 5 or 6 years.  The number of entries of some of the select boxes has gotten so large that the downloaded file has swollen from 200k to 500k+ which present an untennable download problem for some uses whose connect speed is not what it could be.

     I'm still stuck with the error.  If anyone has any thoughts on this, I'd appreciate any suggestions.  Is it possible that there might be a bug in the CF Ajax script file???  Just a thought.

     Dan, thanks again for your help.

     :-}

Len

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation