A thousand apologies. I was mistaken when I said that specifying a single parm 
in the callback function as opposed to two parms solved the problem. My only 
excuse is I had been working on something else all day, and only turned half my 
attention to this. Turning back to this project this evening and testing more 
carefully, I find to my chagrin that specifying just one parm is no better than 
specifying two. Although the parm does get passed to the callback function, 
just as the two parms I was trying earlier got successfully passed, the form 
submission requested in the Ajax.submitForm function does not occur, for the 
reason that the browser thinks the form does not exist, which is false, as 
Verify Generated Source in Firebug can easily show. I get the same results in 
Internet Explorer, which tells me only 'Exception thrown and not caught', i.e., 
the same message as Firefox, but without telling me what the exception was.

What does work (and I tested this carefully - at least it has worked in the 
cases tested so far) is having a single callback functionname - WITHOUT 
PARAMETERS - passed in the third ('callback parameter') position in the 
submitForm call, thus: 

ColdFusion.Ajax.submitForm('fmGenInfo','saveGenInfo.cfm?mode='+action,GenInfoCallback);

Not only does the form get submitted in this case (the data updates get saved) 
- which is further proof that the form really was in the page, despite the 
incorrect error message - but the callback function performs the behaviors I 
directed it to perform (but only because the 'parms' are expressly set by 
assignment statements inside it).

Since there are four different callback behaviors required depending on the 
four combinations of my two parameters, I seem to have no other choice but to 
have four separate submitForm calls, each one specifying a different callback 
function. Tacky, but it will work. (Which are not famous last words, I hope!)

Sorry for the mixup,
Peyton


-----Forwarded Message-----
>From: Peyton Todd <[EMAIL PROTECTED]>
>Sent: Jan 15, 2008 4:10 PM
>To: discussion@acfug.org
>Subject: re: [ACFUG Discuss] Ajax.submitForm Conundrum
>
>Many thanks. I tried your suggestion (i.e., I passed the string: action + '~' 
>+ 145' as a single parm to the callback function and broke it apart inside 
>that function), and it worked beautifully! That is, both the database update 
>and the duties specified in the callback function were executed correctly.
>
>However, before trying that I tried something else (since I was a little leery 
>of what asynchronous might mean in this case), and I'm curious to know why 
>that method did not succeed. Namely, I took the callback parm out of the 
>submitForm statement, and in its stead, I added the following line to the 
>bottom of the target form, saveGenInfo.cfm: <CFSET 
>ajaxOnLoad("GenInfoCallback(#url.mode#)")>, settling for a single parm for now 
>(value = either 'insert' or 'delete'), just to see if an alert statement 
>inside GenInfoCallback (misnamed now of course) would show that it got called, 
>and received the parm. But no luck. The update to SQL Server succeeded but 
>GenInfoCallback was never called.
>
>Why not? And in general, when would it be appropriate to use the callback 
>method vs. the ajaxOnLoad method?
>
>Thanks in advance,
>Peyton
>
>
>-----Original Message-----
>>From: Mischa Uppelschoten ext 10 <[EMAIL PROTECTED]>
>>Sent: Jan 15, 2008 3:08 PM
>>To: Web Site <discussion@acfug.org>
>>Subject: re: [ACFUG Discuss] Ajax.submitForm Conundrum
>>
>>AFAIK the action page you submit to in this case must return only a string 
>>and the callback function can only handle that one string. You can delimit 
>>the string and parse it though.
>>
>>From the docs:
>>callbackhandler   
>>The JavaScript function to handle a normal response. The function must take a 
>>single argument, that contains the response body. This method is used only if 
>>the form submission is asynchronous.
>>
>>
>>Hope that helps!
>>/m
>>
>>
>>
>>: Hello all. Does anyone have a suggestion to make regarding the following
>>:  quandary I find myself in?
>>
>>: I'm trying to submit a form from inside a javascript function thus:
>>
>>: function SubmitFmGenInfo145(action){
>>: //form validation code (omitted here), then:
>>: ColdFusion.Ajax.submitForm('fmGenInfo', 'saveGenInfo.cfm?mode=' + 
>>:    action,GenInfoCallback(action,'145'));
>>: }
>>
>>: When I do so, the callback function, shown below, executes correctly. It 
>>shows
>>:  by the alert statements that it received the parameters, and by the state 
>>of
>>:  the screen that it executed the populateGenInfo.cfm call (I haven't tested 
>>it
>>:  for inserting yet). However, the form does not get submitted, and Firebug
>>:  complains with the following error message: 'uncaught exception:
>>:  ColdFusion.Ajax.submitForm: Form not found, form id: fmGenInfo'. 
>>
>>: function GenInfoCallback(mode,typegroup){
>>: alert(mode); alert(typegroup);
>>: ColdFusion.navigate('populateGenInfo.cfm','getGenInfo');
>>: url = (typegroup == '145') ? 'populateTx.cfm' : 'populateTkdnOrApp.cfm';
>>: if (mode == 'insert'){
>>:   ColdFusion.navigate(url,'getTx');
>>:   ColdFusion.navigate('populateSpecInstr.cfm?mode=no','getSpecInstr');
>>:   }
>>: }
>>
>>: However, the form most definitely does exist in the page, as Firebug's View
>>:  Gererated Source makes clear. (Thank goodness Firebug has this ability;
>>:  otherwise I could never be completely certain what the <cfdiv> contains!) 
>>
>>: Furthermore, when I do nothing but remove the reference to the callback
>>:  function, changing the submitting function to the form shown below, Firebug
>>:  does not complain, and the form submits flawlessly.
>>
>>: function SubmitFmGenInfo145(action){
>>: //form validation code (omitted here), then:
>>: ColdFusion.Ajax.submitForm('fmGenInfo', 'saveGenInfo.cfm?mode=' + action);
>>: }
>>
>>: What could be going on here? Is one not supposed to send parms to a callback
>>:  function? Or am I perhaps using the wrong syntax for doing so?
>>
>>: Thanks in advance for your ideas,
>>: Peyton 
>>
>>
>>
>>: -------------------------------------------------------------
>>: Annual Sponsor FigLeaf Software - http://www.figleaf.com
>>
>>: To unsubscribe from this list, manage your profile @ 
>>: http://www.acfug.org?fa=login.edituserform
>>
>>: For more info, see http://www.acfug.org/mailinglists
>>: Archive @ http://www.mail-archive.com/discussion%40acfug.org/
>>: List hosted by http://www.fusionlink.com
>>: -------------------------------------------------------------
>>
>>
>>
>>
>>
>>
>>
>>
>>Mischa Uppelschoten
>>The Banker's Exchange, LLC.
>>4200 Highlands Parkway SE
>>Suite A
>>Smyrna, GA 30082-5198
>>
>>Phone:    (404) 605-0100 ext. 10
>>Fax:    (404) 355-7930
>>Web:    www.BankersX.com
>>Follow this link for Instant Web Chat:
>>http://www.bankersx.com/Contact/chat.cfm?Queue=MUPPELSCHOTEN
>>---------- Original Message ----------
>>
>>FROM:      Peyton Todd <[EMAIL PROTECTED]>
>>TO:        discussion@acfug.org
>>DATE:      Tue, 15 Jan 2008 14:30:04 -0500 (EST)
>>
>>SUBJECT:   [ACFUG Discuss] Ajax.submitForm Conundrum
>>
>>Hello all. Does anyone have a suggestion to make regarding the following 
>>quandary I find myself in?
>>
>>I'm trying to submit a form from inside a javascript function thus:
>>
>>function SubmitFmGenInfo145(action){
>>//form validation code (omitted here), then:
>>ColdFusion.Ajax.submitForm('fmGenInfo', 'saveGenInfo.cfm?mode=' + 
>>  action,GenInfoCallback(action,'145'));
>>}
>>
>>When I do so, the callback function, shown below, executes correctly. It 
>>shows by the alert statements that it received the parameters, and by the 
>>state of the screen that it executed the populateGenInfo.cfm call (I haven't 
>>tested it for inserting yet). However, the form does not get submitted, and 
>>Firebug complains with the following error message: 'uncaught exception: 
>>ColdFusion.Ajax.submitForm: Form not found, form id: fmGenInfo'. 
>>
>>function GenInfoCallback(mode,typegroup){
>>alert(mode); alert(typegroup);
>>ColdFusion.navigate('populateGenInfo.cfm','getGenInfo');
>>url = (typegroup == '145') ? 'populateTx.cfm' : 'populateTkdnOrApp.cfm';
>>if (mode == 'insert'){
>> ColdFusion.navigate(url,'getTx');
>> ColdFusion.navigate('populateSpecInstr.cfm?mode=no','getSpecInstr');
>> }
>>}
>>
>>However, the form most definitely does exist in the page, as Firebug's View 
>>Gererated Source makes clear. (Thank goodness Firebug has this ability; 
>>otherwise I could never be completely certain what the <cfdiv> contains!) 
>>
>>Furthermore, when I do nothing but remove the reference to the callback 
>>function, changing the submitting function to the form shown below, Firebug 
>>does not complain, and the form submits flawlessly.
>>
>>function SubmitFmGenInfo145(action){
>>//form validation code (omitted here), then:
>>ColdFusion.Ajax.submitForm('fmGenInfo', 'saveGenInfo.cfm?mode=' + action);
>>}
>>
>>What could be going on here? Is one not supposed to send parms to a callback 
>>function? Or am I perhaps using the wrong syntax for doing so?
>>
>>Thanks in advance for your ideas,
>>Peyton 
>>
>>
>>
>>-------------------------------------------------------------
>>Annual Sponsor FigLeaf Software - http://www.figleaf.com
>>
>>To unsubscribe from this list, manage your profile @ 
>>http://www.acfug.org?fa=login.edituserform
>>
>>For more info, see http://www.acfug.org/mailinglists
>>Archive @ http://www.mail-archive.com/discussion%40acfug.org/
>>List hosted by http://www.fusionlink.com
>>-------------------------------------------------------------
>>
>>
>>-------------------------------------------------------------
>>Annual Sponsor FigLeaf Software - http://www.figleaf.com
>>
>>To unsubscribe from this list, manage your profile @
>>http://www.acfug.org?fa=login.edituserform
>>
>>For more info, see http://www.acfug.org/mailinglists
>>Archive @ http://www.mail-archive.com/discussion%40acfug.org/
>>List hosted by http://www.fusionlink.com
>>-------------------------------------------------------------
>>
>>
>>
>
>
>
>-------------------------------------------------------------
>Annual Sponsor FigLeaf Software - http://www.figleaf.com
>
>To unsubscribe from this list, manage your profile @ 
>http://www.acfug.org?fa=login.edituserform
>
>For more info, see http://www.acfug.org/mailinglists
>Archive @ http://www.mail-archive.com/discussion%40acfug.org/
>List hosted by http://www.fusionlink.com
>-------------------------------------------------------------
>
>
>



-------------------------------------------------------------
Annual Sponsor FigLeaf Software - http://www.figleaf.com

To unsubscribe from this list, manage your profile @ 
http://www.acfug.org?fa=login.edituserform

For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------



Reply via email to