Hmmm

Appears to be the most common problem...

Please make a test:

Create a dummy variable in the same class that you are using your VO,
something like

var dummy:DetailData = null;

Keep the rest of the code and tell me the results.

Regards

On Thu, Apr 30, 2009 at 2:58 PM, valdhor <[email protected]>wrote:

>
>
> Yes, I have an interface which I am implementing in the modules. It has a
> single set method that populates a single object with data.
>
> The data transfer is from application to modules only.
>
>
> --- In [email protected] <flexcoders%40yahoogroups.com>, Pedro
> Sena <sena.pe...@...> wrote:
> >
> > Are you transfering data from one module to another(or to its parent) ?
> >
> > On Thu, Apr 30, 2009 at 2:41 PM, valdhor <valdhorli...@...>wrote:
> >
> > >
> > >
> > > Also, I now have it working if I change from trying to coerce to a
> > > valueObject and just use a generic Object instead.
> > >
> > >
> > > --- In [email protected] 
> > > <flexcoders%40yahoogroups.com><flexcoders%
> 40yahoogroups.com>, 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
> > > > >
> > > > > --- In [email protected] 
> > > > > <flexcoders%40yahoogroups.com><flexcoders%
> 40yahoogroups.com><flexcoders%
> > > 40yahoogroups.com>, Alex
> > > > > Harui <aharui@> wrote:
> > > > > >
> > > > > > Could be a compiler bug. If you look at the generated code you
> might
> > > get
> > > > > a clue (or the actual SWF bytes)
> > > > > >
> > > > > > Alex Harui
> > > > > > Flex SDK Developer
> > > > > > Adobe Systems Inc.<http://www.adobe.com/>
> > > > > > Blog: http://blogs.adobe.com/aharui
> > > > > >
> > > > > > From: [email protected] 
> > > > > > <flexcoders%40yahoogroups.com><flexcoders%
> 40yahoogroups.com><flexcoders%
> > > 40yahoogroups.com> [mailto:
> > > > > [email protected] <flexcoders%40yahoogroups.com><flexcoders%
> 40yahoogroups.com> <flexcoders%
> > > 40yahoogroups.com>] On Behalf Of
> > > > > valdhor
> > > > > > Sent: Thursday, April 30, 2009 9:18 AM
> > > > > > To: [email protected] 
> > > > > > <flexcoders%40yahoogroups.com><flexcoders%
> 40yahoogroups.com><flexcoders%
>
> > > 40yahoogroups.com>
> > > > > > Subject: [flexcoders] Why would "as" keyword not work
> > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > I have a bit of a perplexing problem (With a workaround).
> > > > > >
> > > > > > In a datagrid I have an itemRenderer that sets one column to a
> > > > > linkButton. In the constructor I have...
> > > > > >
> > > > > > addEventListener(MouseEvent.CLICK, handleLinkClicked);
> > > > > >
> > > > > > I also have a valueObject imported...
> > > > > >
> > > > > > import Model.ValueObjects.DetailData;
> > > > > >
> > > > > > Now, in my eventListener I try to coerce the event.target.data to
> a
> > > > > detailData object like so...
> > > > > >
> > > > > > var currentItem:DetailData = event.target.data as DetailData;
> > > > > >
> > > > > > I have confirmed that event.target.data is an object of type
> > > > > Model.ValueObjects.DetailData.
> > > > > >
> > > > > > If I set a breakpoint here, then currentItem is null.
> > > > > >
> > > > > > If I try...
> > > > > >
> > > > > > var currentItem:* = event.target.data;
> > > > > >
> > > > > > then currentItem is properly populated as a
> > > Model.ValueObjects.DetailData
> > > > > object.
> > > > > >
> > > > > > The only way to get it to work properly is to do...
> > > > > >
> > > > > > var currentItem:DetailData = event.target.data as
> > > > > Model.ValueObjects.DetailData;
> > > > > >
> > > > > > Also, there is only one class file named DetailData.
> > > > > >
> > > > > > So, why is it that I import the correct class but it fails to
> coerce
> > > > > unless I set the full path to the class file?
> > > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > /**
> > > > * Pedro Sena
> > > > * Systems Architect
> > > > * Sun Certified Java Programmer
> > > > * Sun Certified Web Component Developer
> > > > */
> > > >
> > >
> > >
> > >
> >
> >
> >
> > --
> > /**
> > * Pedro Sena
> > * Systems Architect
> > * Sun Certified Java Programmer
> > * Sun Certified Web Component Developer
> > */
> >
>
>  
>



-- 
/**
* Pedro Sena
* Systems Architect
* Sun Certified Java Programmer
* Sun Certified Web Component Developer
*/

Reply via email to