Dan, So any arguments that I pass in (such as 'SiteID', 'gender', etc) will get place in the event bucket, the I would 'arguments.event.getValue() as normal?
byron On Feb 24, 4:09 pm, Dan Wilson <[email protected]> wrote: > Yeah, Byron, You can't go to a controller directly, because that bypasses > the entire Model Glue framework. > > You are going into an object (The controller) that is only going to act > properly once loaded by Model Glue. > > Take a look at the > RemotingService:http://docs.model-glue.com/wiki/HowTos/HowToUseRemoting#Remoting > > That's the way you should enter your Model Glue application from Ajax if you > want data. > > If you want HTML, then just access it per normal: > > $.get("http://golftown.com/index.cfm?method=chartAudits",{}, > function(res,code) {...}); > > On Thu, Feb 24, 2011 at 4:01 PM, Dan Skaggs <[email protected]>wrote: > > > > > I think what's happening is that a new instance of that controller CFC > > is being created when the remote call comes in from your getJSON() > > call. When that happens, none of the configuration that ModelGlue has > > done to the controller that it set up and cached has happened, so > > you're getting an error accessing the beans scope because that new > > instance was never configured by ModelGlue. > > > I personally have not seen anyone direct AJAX calls to their > > controller CFCs. Most everyone I know of uses some sort of remote > > proxy object. I'm working on sometime similar to that right now for > > one of my apps. If you're interested in seeing my approach, ping me > > off list and we'll figure out how to get the code to you. > > > Dan > > > On Feb 24, 1:24 pm, byron <[email protected]> wrote: > > > Hi all. I have the following MG controller: > > > > component output="false" hint="I am a Model-Glue controller" > > > extends="ModelGlue.gesture.controller.Controller" > > > beans="chartService,patientService" > > > > { > > > > private void function init() { > > > return this; > > > } > > > > remote string function chartAudits(event) { > > > arguments.event.setValue("numCharts",beans.chartService.numChartsByWeek()); > > > } > > > > } > > > > I'm calling this from my display page using jQuery: > > > > $.getJSON("controller/reportController.cfc? > > > method=chartAudits&returnFormat=json",{}, function(res,code) {...}); > > > > When I run it I get the following error: > > > > Element CHARTSERVICE is undefined in a Java object of type class > > > [Ljava.lang.String;. > > > The error occurred in C:\inetpub\wwwroot\Heart2Health\controller > > > \ReportController.cfc: line 15 > > > > 14 : > > > 15 : numCharts = beans.chartService.numChartsByWeek(); > > > > I have verified that I have a bean for chartService. I can access > > > this from public functions. Any ideas of what I might be doing > > > wrong? Can you use the beans scope in a remote function? > > > > Thanks > > > > Byron > > > -- > > 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 > > -- > Plutarch - "The mind is not a vessel to be filled but a fire to be kindled." -- 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
