The VO is being used by this module (And is not used anywhere else). It gets 
populated from a remote object call that this module makes on creationcomplete. 
The arrayCollection of these returned VO's are used to populate a dataGrid.

Now, one column of the dataGrid uses an item renderer based on linkButton. When 
a link is clicked I'd like to have the data in that row passed to another 
component. This other component expects a VO in its constructor.

So, in the itemRenderer, I try to coerce the data property of the event (Which 
should be the VO since the datagrid uses it AND the debugger says it is the 
VO). The coercion fails and I get a null object passed to my component.

This works fine in an application but fails in a module. What I have done is 
moved the click event handler up one level to the datagrid itself and used 
event.target.selectedItem instead of event.target.data and it works fine.


--- In flexcoders@yahoogroups.com, Pedro Sena <sena.pe...@...> wrote:
>
> Pedro - The ValueObject is only being used by this particular module - not
> by the application (Or any other module).
> 
> If the VO is not being used, why are you trying to cast to it?
> 
> I think I didn't understand.
> 
> BTW, Have you done the test that I suggest ?
> 
> Regards,
> 
> On Thu, Apr 30, 2009 at 5:11 PM, valdhor <valdhorli...@...>wrote:
> 
> >
> >
> > Alex - I have read your Modules presentation about twenty times so far as
> > well as any other documentation I could find on Modules and Application
> > Domains. I'm pretty sure I understand everything so far.
> >
> > Pedro - The ValueObject is only being used by this particular module - not
> > by the application (Or any other module).
> >
> > Ian - All other modules work fine with the exchange data. Note that the
> > exchange data and this value object are two different things. I am NOT
> > passing this value object as part of the exchange data. The VO gets created
> > from a remoteObject call.
> >
> > All the above being said, I think I have found my problem. The click event
> > was handled in the renderer. This works fine in an application but does not
> > seem to in a module. By moving the click handler to the datagrid component,
> > the error disappears.
> >
> > This problem crept in whilst I was moving my monolithic app to a series of
> > modules.
> >
> > Thanks for taking the time to push me in the right direction.
> >
> > Steve
> >
> > If anyone can enlighten me as to why click events in item renderers work
> > differently in modules than applications, please do.
> >
> >
> > --- In flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>, Ian
> > Thomas <ian@> wrote:
> > >
> > > As Pedro says - my guess would be that you are passing a DetailData
> > > object from one module to the other when you haven't loaded the
> > > modules in the same ApplicationDomain (or from one compiled .swf to
> > > another, if you're not using modules).
> > >
> > > Take a look at the documentation for ApplicationDomain.
> > >
> > > HTH,
> > > Ian
> > >
> > > On Thu, Apr 30, 2009 at 6:18 PM, Pedro Sena <sena.pedro@> wrote:
> > > >
> > > >
> > > > Are you using modules?
> > > >
> > > > On Thu, Apr 30, 2009 at 2:17 PM, valdhor <valdhorlists@>
> > > > wrote:
> > > >>
> > > >>
> > > >> Hmmm. Looks like I misspoke. now I get...
> > > >>
> > > >> Type coercion failed. Cannot convert
> > > >> Model.ValueObjects::detaild...@11c0a941 to
> > Model.ValueObjects.DetailData.
> > > >>
> > > >> What is the difference between a
> > > >>
> > > >> Model.ValueObjects::DetailData
> > > >>
> > > >> and a
> > > >>
> > > >> Model.ValueObjects.DetailData
> > > >>
> > >
> >
> >  
> >
> 
> 
> 
> -- 
> /**
> * Pedro Sena
> * Systems Architect
> * Sun Certified Java Programmer
> * Sun Certified Web Component Developer
> */
>


Reply via email to