What happens if you call save() directly on the iterator?

Doug

On 1/30/07, Ken Dunnington <[EMAIL PROTECTED]> wrote:

I'm trying to add/update a linked relationship, but am having some
trouble. I can add records to the iterator and verify they are the correct
ones, but calling save() on the parent record doesn't seem to work. My
config looks like this:

        <object name="Profile">
            <hasMany name="Room">
                <relate from="id" to="profileID" />
            </hasMany>
        </object>
        <object name="Room">
            <field source="roomType" field="value" alias="typeName" />
            <hasOne name="Profile">
                <relate from="profileID" to="id" />
            </hasOne>
            <hasOne name="roomType">
                <relate from="type" to="id" />
            </hasOne>
            <hasMany name="Product">
                <link name="roomItems" />
            </hasMany>
        </object>
        <object name="roomItems">
            <hasOne name="Room">
                <relate from="roomID" to="id" />
            </hasOne>
            <hasOne name="Product">
                <relate from="productID" to="id" />
            </hasOne>
        </object>

I have a multi-select list in my form that displays all Products, and I'm
handling the commit in my controller for now (this is where my fileService
lives, and there are multiple file uploads.) This is how I'm adding Product
records to the Room object's Iterator:

    mainRoom.getProductIterator().add(id=allValues[name])
where allValues[name] traces out to the ID of the Product I select in the
form. I can then verify this works like so:

    arguments.event.trace("Main: Product Name",
        mainRoom.getProductIterator().getNext().getName())

This room record is obtained from a profile record which is working fine,
so I don't understand why, when I call profile.save(), it's not cascading
down to the productIterator. The other values in the Room records are saving
properly. Anyone have any thoughts on what I'm doing wrong?

--
Suppose you were an idiot. And suppose you were a member of congress. But
I repeat myself.
-- Mark Twain

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --




--
Doug Hughes


-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Reply via email to