You need to have a typed reference to your
Node class to make sure that it gets linked in. It’s sounding like none
of your code had a typed reference to Node until you added the line in your
MXML.
Matt
From:
[email protected] [mailto:[EMAIL PROTECTED] On Behalf Of cazzaran
Sent: Thursday, June 09, 2005
12:06 AM
To: [email protected]
Subject: [flexcoders] Re: Trouble
getting mx:List to show any changes to dataProvider
WEIRD!
I found the problem, but I'm not sure it makes me
feel any better.
After adding a labelFunction, and seeing that it
wasn't even being
called, I decided to add some funky methods to my
Node class and debug
them, just to see what was happening there.
To my surprise, when I clicked files in debug, I
noticed that the Node
class was not there. Apparently, though the array
group.nodes was
populated with Node objects, and they had all the
correct data that
existed in the remote database, they weren't being
instantiated; or,
at least, they weren't as Node objects.
What I did, was a simple var node:Node = new
Node(); in my main MXML
file. This empty class does nothing except
register that there is a
Node class that can be instantiated. After that,
my problem is solved.
The List shows all the Nodes correctly, and Node
appears in the list
of debuggable classes.
This isn't, however, a fix. WHY does Flex
instantiate all my remote
objects except Node? I properly state the
Object.registerClass, and
upon debugging the code, it SAYS that the
group.nodes is an Array of
Nodes. My remote POJO doesn't deviate from
standard Java bean
structure. There's nothing special about my Node
class, especially
when compared to my other POJOs which work fine.
It doesn't reference
any weird classes, and certainly none that my
other operating POJOs
don't also reference and operate on. This is a
strange, and seemingly
unexplainable problem.
Any insight would be helpful. Especially if it's
something *I* did! -Josh
--- In [email protected], "Tracy
Spratt" <[EMAIL PROTECTED]> wrote:
> If your dataProvider has data then look again
at your labelField
> settings or labelFunction code.
>
> In a labelFunction, be sure to use the
dataProvider API methods, not
> array or xml methods. Use a trace in
the labelFunction, or step through
> it in the debugger, you should be able to see
what is happening.
>
> What does your array contain? Indexed Arrays
or Objects?
>
> Post a sample of the data and the
labelFunction.
>
> Tracy
>
> -----Original Message-----
> From: [email protected]
[mailto:[EMAIL PROTECTED] On
> Behalf Of cazzaran
> Sent: Wednesday, June 08, 2005 6:32 PM
> To: [email protected]
> Subject: [flexcoders] Trouble getting mx:List
to show any changes to
> dataProvider
>
> For some reason, I have one mx:List in mxml
that refuses to show the
> contents of its dataProvider.
>
> I have:
>
> <mx:List height="100%"
width="100%" id="theRDUList"
> vScrollPolicy="auto"
dragEnabled="false" change="" selectable="true"
> hScrollPolicy="auto"/>
>
> And my code to change it is:
>
> theRDUList.dataProvider = group.nodes;
>
> The thing is, upon debug, I can see that group.nodes
is full of an
> Array, *AND* the dataProvider property of
theRDUList is ALSO full of
> the same data. So the dataProvider is getting
set, but the list
> absolutely refuses to show anything, despite
my attempts.
>
> I've tried multiple labelField settings,
labelFunc settings, adding
> implicit gets to my Node object (in the
Array) so that nothing should
> be required on the MXML tag... nothing. And
all my other lists work
> fine.
>
> Anyone know of something I'm missing? This
seems straight forward...
>
> Weird...
>
> -Josh
>
>
>
>
>
>
> Yahoo! Groups Links
Yahoo! Groups Links