I'm new to MG3 and have been trying to learn the framework by reviewing the docs and other developers code, specifically LHP. I still have a ways to go to get up to speed . I have run into a frustrating issue that I can not resolve. Any help would certainly be appreciated.A simple client table in DB.The event page.clients returns the full list of clients properly. No problem there. However, when I link from page.clients to page.client and pass the clientID to the ClientController, my struct is always empty.page.client<cfset client = event.getValue("client") /><cfdump var="#client#" label="clientDetails">ClientController<cffunction name="getClient" access="public" output="false"><cfargument name="event" type="any"><cfset var clientid = arguments.event.getValue("clientID") /><cfset var client = beans.clientService.getClient(clientID) /><cfset arguments.event.setValue("client", client)></cffunction>ModelClientService<cffunction name="getClient" access="public" returntype="any" output="false" hint="Gets a client bean based on the client's ID."><cfargument name="clientID" type="any" required="false"><cfif structKeyExists(arguments,"clientID") and arguments.clientID NEQ 0><cfreturn variables.gateway.getClient(arguments.clientID)><cfelse><cfreturn variables.gateway.newClient()></cfif></cffunction>ClientGateway<cffunction name="getClient" access="public" returntype="clientBean" output="false"><cfargument name="clientID" type="any" required="true"><cfset var cBean = createObject("component", "ClientBean") /><cfset var clientData = "" /><cfquery name="clientData" datasource="#variables.dsn#" username="#variables.username#" password="#variables.password#">SELECT clientID, clientname, clientaddress, clientcity, clientstate, clientzipcode, clientphonenumber, clientdateaddedFROM dbo.clientsWHERE clientid = <cfqueryparam value="#arguments.clientID#" /></cfquery><cfif clientData.recordCount><cfset cBean.setClientID(clientData.clientid) /><cfset cBean.setClientName( clientData.clientname) /><cfset cBean.setClientAddress(clientData.clientaddress) /><cfset cBean.setClientCity(clientData.clientcity) /><cfset cBean.setclientstate(clientData.clientstate) /><cfset cBean.setClientZipcode(clientData.clientzipcode) /><cfset cbean.setClientPhoneNumber(clientData.clientphonenumber) /><cfset cbean.setClientDateAdded(clientData.clientdateadded) /></cfif><cfset cBean.setConfig(variables.config) /><cfreturn cBean></cffunction>
ClientBean<cfset variables.instance = structNew() /><cfset variables.instance.clientid = 0 /><cfset variables.instance.clientname = "" /><cfset variables.instance.clientaddress = "" /><cfset variables.instance.clientcity = "" /><cfset variables.instance.clientstate = "" /><cfset variables.instance.clientzipcode = "" /><cfset variables.instance.clientdateadded = "" />{{{ setting and getting all columns }}}All the accessors are referenced... followed by the instance<cffunction name="getInstance" returntype="struct" access="public" output="false"><cfreturn duplicate(variables.instance)></cffunction><cffunction name="setConfig" returntype="void" access="public" output="false" hint="Used to allow beans to inject settings"><cfargument name="config" type="any" required="true"><cfset variables.config = arguments.config></cffunction>I have made a dozen changes and I can not get the specific client details returned to the page.client event. I try and dump the result and it returns
clientDetails - struct [empty] Frustrated.My user model is working fine and is almost the exact same code...--
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 model...@googlegroups.com
To unsubscribe from this group, send email to
model-glue+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en
Nice catch Ezra, that does look like the issue...
Dw
>> 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 model...@googlegroups.com
> To unsubscribe from this group, send email to
--
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 model...@googlegroups.com
To unsubscribe from this group, send email to
model-glue+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en
Hi dear,
Can some send me sample application code which covers Model + controller +View with very less code so I can understand and I can do some practice.
Highly appreciated
M.A
Thanks Dan. That helps explain the variable scope.
--
Hi dear,
Can some send me sample application code which covers Model + controller +View with very less code so I can understand and I can do some practice.
Highly appreciated
M.A
On Wed, Jul 18, 2012 at 7:22 PM, Craig Derington <cderi...@gmail.com> wrote:
Thanks Dan. That helps explain the variable scope.
--
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 model...@googlegroups.com
To unsubscribe from this group, send email to
--
--
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 model...@googlegroups.com
To unsubscribe from this group, send email to
model-glue+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en
---
You received this message because you are subscribed to the Google Groups "model-glue" group.
To unsubscribe from this group and stop receiving emails from it, send an email to model-glue+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
hi dan,
thanks for reply, i just checked your "helloworld" app. This sample app Model/ folder also empty i need something where your using little business logic in model .
Thanks
Regards,
M.A
hi dan,
thanks for reply, i just checked your "helloworld" app. This sample app Model/ folder also empty i need something where your using little business logic in model .
Thanks
Regards,
M.A
From: model...@googlegroups.com [mailto:model...@googlegroups.com] On Behalf Of Dan Skaggs
Sent: Monday, April 08, 2013 4:29 PM
To: model...@googlegroups.com
Subject: Re[2]: [Model-Glue] Issue with MG - Struct Returns Empty
You might want to look at our "helloWorld" sample app. All our sample apps reside in a different repository. You can find them here:
Dan
------ Original Message ------
From: "Muhammad Amir" <onlya...@gmail.com>
Sent: 4/8/2013 6:43:05 AM
Subject: Re: [Model-Glue] Issue with MG - Struct Returns Empty
--
Hi dear,
Can some send me sample application code which covers Model + controller +View with very less code so I can understand and I can do some practice.
Highly appreciated
M.A