Hello,

I am working on my first MG project and am still not quite getting how
to hard wire objects in the Coldspring XML. Right when I think I'm
starting to get it, I come across some unanticipated hick-ups.

So, I have a PersonFormBean object and I'm trying to add a collection
of phone numbers for a person...a one to many thing.

I have a personFormBean and this bean requires a generic collection
container:

<bean id="ObjCollection" class="logon.model.ObjCollection" />

This cfc has generic methods such as "add", "getAt", "removeAt".  So,
I want to add a phone numbers collection to the PersonFormBean:

        <bean id="PersonFormBean" class="logon.model.PersonFormBean" >
          <constructor-arg name="PhoneCollection"><ref  bean="ObjCollection" /
></constructor-arg>
        </bean>

For good measure I have a PhoneFormBean as well:

<bean id="PhoneFormBean" class="logon.model.PhoneFormBean" />

The PersonFormBean init method has constructors for the
PhoneCollection:

<cffunction name="init" access="public"
returntype="logon.model.PersonFormBean" output="false">

...

<cfargument name="PhoneCollection" type="any" required="false"
default="" />

...
<cfset setPhoneCollection(arguments.PhoneCollection) />


</cffunction>


        <cffunction name="setPhoneCollection" access="public"
returntype="void" output="false">
                <cfargument name="PhoneCollection" type="any" required="yes">
                <cfset variables.instance.PhoneCollection =
arguments.PhoneCollection>
        </cffunction>

        <cffunction name="getPhoneCollection" returntype="any"
output="false">
                <cfreturn variables.instance.PhoneCollection>
        </cffunction>


So, the problem is that none of the methods of PhoneCollection are
accessible.  As a sanity check I commented out all the init lines
above and added the following to the init() method in PersonFormBean:

<cfset variables.instance.Phonecollection = createobject
("component","logon.model.objCollection")>

Once I added this, then everything started working properly through
the rest of my app.  Clearly, something is not wired up correctly in
the Coldspring.xml....

Any thoughts?

Joe


--~--~---------~--~----~------------~-------~--~----~
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

For more about Model-Glue, check http://www.model-glue.com .
-~----------~----~----~----~------~----~------~--~---

Reply via email to