Chuck, you should not be editing the AbstractRemoteService. That is an internal framework object and should be left alone. There is never any reason to edit any internal framework object.
Secondly, while you are on the right track with how to get out the value you need, you are doing it in the wrong place. You need to handle this in a different place,possibly in your RemoteService, but definitely not in the AbstractRemoteService. You can make any number of CFCs that extend the AbstractRemoteService, and you should make your customizations in there. That way the specific behavior and intelligence needed for your application, stays in your applicaiton. It is not the job of the AbstractRemoteService to know, or care about who will be consuming the data and any specific formatting or interpretation needed by a data consumer. DW On Thu, Jan 14, 2010 at 2:06 PM, Chuck Savage <[email protected]> wrote: > Right I understand that. > > But with a Bind expression, you want only a single value returned. I > got my code to work, but had to create these functions, and modify my > form like... > > <cfform name="frmList"> > <cfinput name="txtSearch" type="text" value=""> > <cfinput name="txtResult" type="text" > bind="cfc:mg.RemotingService.executeBindEvent > (eventName='cservice.search', values={txtsea...@keyup})"> > </cfform> > > The RemotingService has this new function, > > <!--- pass in your values is name=value pairs to the function, all are > passed as the > arguments structure to the super.executeBindEvent() > ---> > <cffunction name="executeBindEvent" output="false" access="remote" > returntype="any"> > <cfargument name="eventName" type="string" required="true" /> > <cfargument name="returnValue" type="string" required="false" > default="result" /> > > <cfreturn super.executeBindEvent(arguments.eventName, arguments, > arguments.returnValue) /> > </cffunction> > > > In AbstractRemotingService.cfc I added this function, > > <cffunction name="executeBindEvent" output="false" access="remote" > returntype="any"> > <cfargument name="eventName" type="string" required="true" /> > <cfargument name="values" type="struct" required="false" > default="#StructNew()#"/> > <cfargument name="returnValue" type="string" required="false" > default="result" /> > <cfset var local = StructNew()/> > > <!--- For Javascript post calls to the service ---> > <cfif cgi.request_method eq "post"> > <cfset arguments.values = duplicate(form)/> > </cfif> > > <cfset local.event = getModelGlue().executeEvent > (argumentCollection=arguments) /> > > <cfset local.result = local.event.getValue(returnValue) /> > > <cfset resetCFHtmlHead() /> > <cfreturn local.result /> > </cffunction> > > At the moment, the form just echo's the typed text via my controller's > code, but it could be made to do lookups in the database which is to > come and via a bind to a cfgrid. More testing to come. > > Just try my code, its self explanatory. If what I've done can be done > with existing MG code let me know, but I can't use a struct in a > <cfinput> bind expression and I can't use a struct in the return value > either. > > -- > Model-Glue Sites: > Home Page: http://www.model-glue.com > Documentation: http://docs.model-glue.com > Bug Tracker: http://bugs.model-glue.com > Blog: http://www.model-glue.com/blog > > You received this message because you are subscribed to the Google > Groups "model-glue" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected]<model-glue%[email protected]> > For more options, visit this group at > http://groups.google.com/group/model-glue?hl=en > -- “Come to the edge, he said. They said: We are afraid. Come to the edge, he said. They came. He pushed them and they flew.” Guillaume Apollinaire quotes
-- Model-Glue Sites: Home Page: http://www.model-glue.com Documentation: http://docs.model-glue.com Bug Tracker: http://bugs.model-glue.com Blog: http://www.model-glue.com/blog You received this message because you are subscribed to the Google Groups "model-glue" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/model-glue?hl=en
