I suppose load on a record should reset its instance data…

 

Doug

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jared Rypka-Hauer
Sent: Sunday, April 30, 2006 4:05 PM
To: [email protected]
Subject: Re: [Reactor For CF] Strange behaviour

 

Erik-Jan,

 

My first thought is that you're starting with an empty user record, then loading it with something like User.load(userId=1) and then trying to call the iterator for getting newsletters... the problem I've seen in the past few days is that the iterator doesn't reset itself when the user is populated with data from a DB row. This would also explain why your test page works, because you're (possibly, anyway) creating and loading user data in the same step.

 

Try calling User.getNewsletterIterator().reset() and then User.getNewsletterIterator().getQuery() in your MG app to see if it changes anything.

 

Laterz,

J

 

------------------------------------------------

Jared C. Rypka-Hauer

Continuum Media Group LLC

http://www.web-relevant.com

Member, Team Macromedia - ColdFusion

 

"That which does not kill me makes me stranger." - Yonah Schmeidler



 

On Apr 30, 2006, at 3:14 AM, Erik-Jan Jaquet wrote:



Hi all,

 

I am still working on the app with Model-Glue and Reactor, and I am

wondering if someone could explain why i get a certain behaviour.

 

I copied the security setup from Doug's Blog example. I now have a user that

can log in, that works like a charm. But I have added a relationship to that

user, a user now hasmany newsletters.

 

I have the userrecord available in my view at all times, so I thought I

could just call the newsletter_iterator at all times, to see which

newsletters the user subscribed to.

 

But the strange thing is, when I call the iterator, it returns an empty

query. At first I thought it had something to do with my setup, but when I

run the code on a test page, without Model-Glue, it works fine! I get a

query with 3 records, which is what I expected.

 

I checked the userid in ModelGlue, it returns the correct user, so the

record is loaded with the correct user.

 

But why is the newsletter_iterator coming up with no newsletters then? Can

anyone tell me if this is expected behaviour, while working with Model Glue,

or am I missing something?

 

Kind regards,

 

Erik-Jan

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

Reply via email to