Hi - recently I've been struggling with what ought to be a simple
task: populating a bean from a form... something we've all done a
thousand times. I am using the latest bits (M6.2.2 I believe it is
now?) on CF 9.0.1 and every time I tried to initialize my bean it
appeared that my init method would properly loop through my fieldnames
and dynamically create the fields in a struct, but would never set
them to the values I listed?
I tried straight a straight forward approach:
for i=1 ......
fields.a[i] = "foo";
fields.b[i] = "bar";
etc.
next I tried:
structInsert(fields, a1,'foo');
etc.
every time I would check the cfc in the rc panel of the CB debugger
window and it would only show that the fields.a1 key(s) were created,
but no values set. I was baffled. This is CF 101 stuff...
I then tried creating separate methods in my cfc to do the settings,
etc. (thinking it may be in the way the init was being called...) all
to no avail... and then that's when I saw it. I noticed that when I
created a separate method named qqq() to do these sets it appeared in
the method of the object in the CB debug rc panel, but then when I
deleted the method from the CFC, it still appeared as a method in the
obj in the CB debugger panel???
This is a transient obj? WTF? So I cleared all caches, sessions,
fwreinit'ed the app, etc. - the deleted method still showed? When I
viewed it in the ColdFusion cfc explorer, it properly was NOT there,
but when I went back to the CB debug panel it still showed. It only
went away when I restarted the CF service.
So then I started manually dumping the rc at the top of my page and
found out that I was doing everything properly all along - it just
appeared to me that something was amiss because I was relying on the
CB debugger panel's representation of my obj and never really moved on/
tested beyond that!
So I think that there is something amiss with CB's object explorer
used by the debug panel? I have every tyoe of caching in CF Admin
turned off on these testing and dev machines, so it's not a CF thing
(especially because CF's object explorer shows a proper cfc
representation).
This is reproducible and happens on multiple machines.
Andy