Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

parameter not passed in error

4 views
Skip to first unread message

emerys

unread,
Mar 13, 2009, 4:49:26 PM3/13/09
to
I have Flex 3.0.214193 and CF 8,0,0,176276 and Oracle 10.2.0.3.
I've been search for several days for an answer to this one. There is very
little out there about this type of error, but then there is very little about
any problems with Flex and ColdFusion.
In Flex, I have two comment fields. the .cfc has two update functions that
update the comments, because they are in two different tables. The first update
works like a champ. The second one consistantly shows this error in the CF
application log: The NEWENGREMARK parameter to the updateEng function is
required but was not passed in. I've used to Alert.Show to verify that Flex
does have a value in that variable when it calls the .cfc. I've even tried
passing the first variable that worked in the first update, and then a litteral
value. Everything yields the same cryptic error message. I must be looking at
the wrong thing.
The only things I've found on the web about this, say the variables should
have a scope (is that a scope in Flex or in the .cfc) and the column names
should be in upper case (because it's Oracle).
Here's the .cfc code (is that where the error is, or is it in Flex?). The
UpdateDescription function works, but the UpdateEng doesn't.

Thanks for any help, or spelling errors you can point out.
Scott

<cffunction name="UpdateDescription" access="remote" returntype="string" >
<cfargument name="newDescription" required="true" type="string">
<cfargument name="descriptionUpPK" required="true" type="string">

<cfquery name="UpdateDescription" datasource="CAAA">
update DRDESCRIPTION
set DESCRIPTION = <cfqueryparam cfsqltype="cf_sql_CLOB"
value="#arguments.newDescription#" />
where CONTROLNUMBER=<cfqueryparam cfsqltype="cf_sql_varchar"
value="#arguments.descriptionUpPK#" />
</cfquery>
<cfset msg = 'The DR was updated.'>
<cfreturn msg/>
</cffunction>

<cffunction name="UpdateEng" access="remote" returntype="string" >
<cfargument name="newENGRemark" required="true" type="string">
<cfargument name="engUpPK" required="true" type="string">

<cfquery name="UpdateEng" datasource="CAAA">
update DRENGINEER
set ENGREMARKS = <cfqueryparam cfsqltype="cf_sql_CLOB"
value="#arguments.newENGRemark#" />
where CONTROLNUMBER=<cfqueryparam cfsqltype="cf_sql_varchar"
value="#arguments.engUpPK#" />
</cfquery>
<cfset msg = 'The DR was updated.'>
<cfreturn msg/>
</cffunction>

emerys

unread,
Mar 13, 2009, 4:49:35 PM3/13/09
to

BKBK

unread,
Mar 22, 2009, 10:01:08 AM3/22/09
to
There is a high chance the error is in the Flex call. I think UpdateEng() is being called without the newENGRemark parameter. Could we see the code making the call?


emerys

unread,
Mar 23, 2009, 7:59:04 AM3/23/09
to
BKBK,
Here is the Flex code:
Again the description update works everytime, but the ENG update throws this
strange error. I've used Alert.Show to make sure the EngRTE.html.Text has a
value. I've switched this to send the description variable to the Eng update.
I've even hardwired a value to the call. Everytime, CF replies that it didn't
get a value for the newENGRemark argument.
Thanks for your help.
Scott

<mx:RemoteObject id="Remarks" source="cfcs/manufacturing/DR"
showBusyCursor="true" destination="ColdFusion">
<mx:method name="updateDescription" fault="faultHandler(event)" >
<mx:arguments>
<newDescription>{DescriptionRTE.htmlText}</newDescription>
<newENGRemark>{EngRTE.htmlText}</newENGRemark>
<descriptionUpPK>925001</descriptionUpPK>
</mx:arguments>
</mx:method>
<mx:method name="UpdateEng" fault="faultHandler(event)" >
<mx:arguments>
<newENGRemark>{EngRTE.htmlText}</newENGRemark>
<engUpPK>925001</engUpPK>
</mx:arguments>
</mx:method>
</mx:RemoteObject>

BKBK

unread,
Mar 25, 2009, 2:40:02 AM3/25/09
to
One thing jumps out. Flex calls updateDescription() with 3 arguments and UpdateEng() with 2 arguments, whereas your earlier posting shows that each function expects 2 arguments.


emerys

unread,
Mar 25, 2009, 6:55:52 AM3/25/09
to
BKBK,
That is part of my thrashing about, trying to either make it work or get a
real error message. I changed the Flex and .cfc to pass the previously missing
parameter to the descriptionUpdate function. If I pass the newENGRemark
variable to the first update function, everything is fine; if I pass it to the
second update function, it is missing.
I changed the Flex and .cfc be all upper case and all lower case, but there
was no difference.
I created a .cfm page to cfinvoke the same .cfc; then I passed some
hardwired literals to the .cfc - everything was fine.
I put the Flex code back to only pass two parameter to each update
function, but in the .cfc, in the second update, I added the default option to
both of the parameters. That worked; it went ahead and updated the record with
the defaults. (That's not really what I wanted to do for production) . I
changed the .cfc so the newENGRemark was not required. Then it said the second
parameter was missing. In the Flex code, you can see that I am passing a
litteral, 925001, to the .cfc. The parameter exists in Flex, but when it gets
to the .cfc, it doesn't exist.
This problem has been beating me for too long. I think I will restructure
the database so that I can do what I need to with one update function call. The
initial test seems to show this will work.
Basically I am floored by this problem. Everything I've tried to get around
it or get a real error hasn't worked. Could it be something to do with Oracle
CLOB data type? Because I was able to make it work by using a .cfm to cfinvoke
the .cfc, it seems that the problem would have to be in Flex. But the Flex only
seems to have a problem with the second update, UpdateEng. So I deleted the
second update, copied the first, and changed the the minimum to make it work,
but it didn't. Then I switched the order in the Flex and .cfc to have the
second update first - same difference. Then I even took out the
descriptionUpdate altogether, but it still gave that same error.
Does anyone know of some diagnostic tool that can catch what is being
passed on the AMF channel? Can you do a dump or a debug of a .cfc that is
called by Flex?
Scott

BKBK

unread,
Mar 26, 2009, 2:38:58 AM3/26/09
to
As far as I can see, there is nothing wrong with your code. I would leave it as
it is, with one exception. You should initialize each return-variable in the
functions in the CFC with [i]var[/i]. That makes them thread-safe.

The problem seems to revolve around the value {EngRTE.htmlText}. So, what
happens when you replace
[i]<newENGRemark>{EngRTE.htmlText}</newENGRemark>[/i]
with
[i]<newENGRemark>0</newENGRemark>[/i]?

emerys

unread,
Mar 26, 2009, 6:24:32 AM3/26/09
to
BKBK,
I tried to pass a litteral value (<newENGRemark>0</newENGRemark>) and it
gave the same error message. So I tried to pass the value that worked in the
first update function (<newENGRemark>>{DescriptionRTE.htmlText}</newENGRemark>)
and it returned the same error about a missing parameter.
Thanks for the suggestion about making the return message thread safe.
Scott

BKBK

unread,
Mar 26, 2009, 6:15:23 PM3/26/09
to
This may not mean much, but everything counts now:
[i]source="cfcs.manufacturing.DR"[/i]


The ScareCrow

unread,
Mar 26, 2009, 6:17:11 PM3/26/09
to
How are the methods being called ?
I assume with this.Remarks.UpdateEng, if so try passing the parameters
straight into it
this.Remarks.UpdateEng(this.EngRTE.htmlText, '925001')

I use a action script function saveItem() (see attached code)
I also use a MVC

You can then check the method call like so
Alert.show( ObjectUtil.toString(this.Remarks.UpdateEng.arguments) );

I then use cffile to save the cfc arguments to a text file as the first action
in the cfc
Or you can include a result attribute on the method and return the cfc
argument back to flex to check the value.

If the value is present in the first function, then just pass all values
through this function and have 2 update queries in the one function.

Check to ensure that the name of the form element matches the call in the
method.

Ken

<mx:Script>
<![CDATA[
private function saveDescription():void
{
this.dataManager.save(this.DescriptionRTE.htmlText. this.EngRTE.htmlText,
925001);
}

private function saveEngRTE():void
{
this.dataManager.save(this.EngRTE.htmlText. 925001);
}
]]>
</mx:Script>

<mx:RemoteObject id="Remarks" source="cfcs/manufacturing/DR"
showBusyCursor="true" destination="ColdFusion">

<mx:method name="updateDescription" fault="faultHandler(event)" />
<mx:method name="UpdateEng" fault="faultHandler(event)" />
</mx:RemoteObject>


<mx:Button id="saveBtn" label="Save" click="saveDescription()" />
<mx:Button id="saveBtn" label="Save" click="saveEngRTE()" />

BKBK

unread,
Mar 27, 2009, 1:56:48 AM3/27/09
to
An original way to test the case there, Scarecrow. Just a typo: [i]htmlText[/i]
should be followed by a comma.

If yours too fails, then it can only be one of two things. Either we're
missing something obvious, or there is a bug.


emerys

unread,
Mar 27, 2009, 11:33:15 AM3/27/09
to
Opps, And I thought that the path to the .cfc would only work with dot seperated, not slash seperated.

I changed to the dots, but no different.

emerys

unread,
Mar 27, 2009, 11:37:22 AM3/27/09
to
Scarecrow,
I tried to make the changes as you suggested, but now it won't compile. It
doesn't give me an error, it just won't compile.
What is the this.datamanager.save? is that an external function that you
have?
Scott

BKBK

unread,
Mar 28, 2009, 3:06:47 AM3/28/09
to
A stab in the dark. Let's rule out any caching mechanism. Replace every occurrence of [i]newENGRemark[/i] in the Flex call and in the CFC with [i]new_ENG_remark[/i]. What happens then?


emerys

unread,
Mar 28, 2009, 3:40:31 PM3/28/09
to
BKBK,
Thanks for your help, but I think I'm just going to give up on this error.
I'm moving forward with Scarecrow's suggestion to use just one update function
call. That sems to be working very well right now. And the suggestion to cffile
write the parameters out to a file has been very helpful.
A little while ago, I couldn't get Flex to compile the project. Then I
Project/Probe, and the compile came back on.
Thanks to you and Scarecrow for your help, but I've spent too much time
(about two weeks) on this error, and too much asprin.
Again, thanks for your help.
Scott

BKBK

unread,
Mar 29, 2009, 8:44:48 AM3/29/09
to
OK. I'll keep my antenna tuned to any signals about the subject.

Good luck.


The ScareCrow

unread,
Mar 29, 2009, 6:17:21 PM3/29/09
to
Sorry Scott,
datamanager is the id of my remoteobject.

I have also had the odd occasion where my changes where not reflected. I
found that doing a project cleam helped.

menu option project/clean.

The path to the cfc has to be dot seperated, dame copy and paste...

Ken

0 new messages