all groups > coldfusion flash integration > december 2005 >
You're in the

coldfusion flash integration

group:

Arguments Passed to Remoting CFC


Arguments Passed to Remoting CFC hanzelmans
12/8/2005 7:23:09 PM
coldfusion flash integration:
I used the code for the Real Estate Flash Remoting example on
http://www.asfusion.com/blog/category/cfform to make a search interface for an
application that we are developing.

I modified the code and it works to a point. The gateway returns the query
results to the grid. However, I can't get the form or service to pass the
arguments to the gateway query.

I've even tried hard coding the values in the ListingService component to pass
to the query, but that doesn't seem to work either.

Here is my code for the service, gateway and form. Any assistance would be
greatly appreciated as this is the only block I have to get this moving.

Is there a glaring error here? If not, could anyone point me in a direction
on how to debug something like this? I've never really tried using
remoting/services previously, so I'm at a loss at where to start.

Thanks for any assistance,
Steve

Service:
<cfargument name="teacher" required="no" type="numeric" default="0"
hint="Primary key"/>
<cfargument name="fromDate" required="no" type="string" default=""
hint="Search From Date" />

<!--- call a component sitting in memory (application scope) --->

Index:
function submitSearch():Void
{
<!--- get all the search criteria items --->
var searchArguments = {};

<!--- simple text input --->
searchArguments.date = search_fromDate.text;

<!--- dropdowns --->
searchArguments.teacher = search_teacher.value;

<!--- show clock cursor --->
mx.managers.CursorManager.setBusyCursor();
<!--- call service --->
Homework.myGlobalObjects.ListingService.search(searchArguments);
}
<cfreturn
application.ListingGateway.search(argumentCollection=arguments) />
Re: Arguments Passed to Remoting CFC GotJosh?
12/12/2005 5:10:37 PM
Hey there,

Make sure you have CF debugging turned on and then restart CF. This at least
helps see were the error is.

First thing I noticed is the code you submitted above is for the submit
section to the populate the grid, that code has nothing to do with sending data
from a form to the next part of the cfc, which handles updates, creates and
removes.

Make sure all your remote object calls have been modified to go to the right
spot or you will get lots of errors as well.



The code i have for sending data from a form to the cfc (modified from
realestate example app):

public function submitEdit():Void {
var editArguments:Object = {};

<!--- simple text inputs --->
editArguments.userID = edit_userID.text;
editArguments.bemsID = edit_bemsID.text;
editArguments.firstName = edit_firstName.text;
editArguments.lastName = edit_lastName.text;
editArguments.middleName = edit_middleName.text;
editArguments.email = edit_email.text;
editArguments.phone = edit_phone.text;
editArguments.fax = edit_fax.text;
editArguments.mobile = edit_mobile.text;


<!--- radio button --->
editArguments.chkThrustMem = edit_chkThrustMem.selectedData;;
editArguments.thrust = edit_Thrust.selectedData;
editArguments.active = edit_Active.selectedData;


<!--- checkboxes --->
<!--- SAMPLE
editArguments.hasPool = edit_hasPool.selected;
--->


<!--- dropdowns --->
editArguments.processRole = edit_processRole.value;
editArguments.applicationRole = edit_applicationRole.value;

<!--- only make call if all required fields are supplied --->
if( mx.validators.Validator.isStructureValid(this, 'frmUsers') ){
<!--- show clock cursor --->
mx.managers.CursorManager.setBusyCursor();

if (frmUsers.myGlobalObjects.isEditMode) {
<!--- call service --->
frmUsers.myGlobalObjects.adminServices.updateUser(editArguments);
}
else {
<!--- call service --->
frmUsers.myGlobalObjects.adminServices.createUser(editArguments);
}
}
}




BUTTONS that activate this code:

<!--- button bar --->
<cfformgroup type="hbox">
<cfformgroup type="horizontal" style="horizontalAlign:left;
marginTop:4;">
<cfformitem type="text" id="actionMessage" style="fontWeight:bold;
color:##235986;" width="200">You are currently adding a user</cfformitem>
<cfinput type="button" name="editBtn" width="100"
value="{(userList.selectedItem == undefined)?'Submit':'Apply Changes'}"
onclick="submitEdit()" />
<cfinput type="button" name="removeBtn" value="Remove User"
disabled="{(userList.selectedItem == undefined) }" onclick="submitRemove()" />
<cfinput type="button" name="addBtn" value="Add new User"
onclick="setMode('add')" disabled="{(userList.selectedItem == undefined) }"/>
</cfformgroup>
</cfformgroup><!---End Button bar--->
Re: Arguments Passed to Remoting CFC hanzelmans
12/12/2005 5:35:01 PM
Josh,
Thanks for the response.

You are correct in that the code that I attached was for the purpose of
populating the grid. That is where the problem is.

When I select a name/date, that information is not being passed to the query
that populates the grid. The query runs properly and populates the grid with
data. However, it doesn't use the data that is being passed from the search.

I'm going to take a look at the code that you included, but wasn't sure if
your answer might change with that in mind.

Thanks,
Steve
AddThis Social Bookmark Button