[flexcoders] Re: Coercion failed ArrayCollection with Objects inside Object AMFPHP 1.9

2007-03-22 Thread thuijzer
Finaly I found a solution for my problem.
I created this class in PHP:

class ArrayCollection
{
var $_explicitType;
var $source;

function ArrayCollection()
{
$this->_explicitType = "flex.messaging.io.ArrayCollection";
$this->source = array();
}
}

When I use this in places where I need an ArrayCollection, Flex
recognizes this Class as an ArrayCollection :)

- Thomas

--- In flexcoders@yahoogroups.com, Thomas Huijzer <[EMAIL PROTECTED]> wrote:
>
> Hi All,
> 
> With AMFPHP 1.9 I am trying to return an Object containing some vars
and an ArrayCollection. Inside this ArrayCollection there are other
Objects. But I can't get this to work in Flex.
> For example:
> 
> Flex class
> 
> package com.app.classes
> {
> import mx.collections.ArrayCollection;
> 
> [RemoteClass (alias="com.app.classes.RemoteClass")]
> public class MyClass
> {
> public var id: Number;
> public var list: ArrayCollection;
> }
> }
> 
> package com.app.classes
>  {
> [RemoteClass (alias="com.app.classes.RemoteClassObj")]
>  public class MyClassObj
>  {
>  public var id: Number;
>  public var name: String;
>  }
>  }
> 
>  PHP class
>  
> class MyClass
> {
> var $id;
> var $list;
> }
> class MyClassObj
> {
> var $id;
> var $name;
> }
> function getData()
> {
> $data = new MyClass;
> $data->id = 1;
> $data->list = array();
> $data->list[0] = new MyClassObj;
> $data->list[0]->id = 2;
> $data->list[0]->name = "myName";
> return $data;
> }
> 
> When I return this to Flex, the MyClass is filled ok. By the list
coercion fails.
> Any idea to solve this problem?
> Thank you.
> 
>  
> -
> Need Mail bonding?
> Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.
>




[flexcoders] Re: Coercion failed ArrayCollection with Objects inside Object AMFPHP 1.9

2007-03-22 Thread thuijzer
It must be something basic, but I can't find it.
I dubbelchecked every class Remote and in Flex. They are all the same.
Locations are all the same.

Now I checked what is comming from the remote server. Alle Classes are
typed correct. But where there should be ArrayCollections, there are
Array's, but containing the right typed Classes.
So the convertion inside Flex is the problem.
Flex recognizes all Classes correctly, but not the Array's as
ArrayCollections.
Every Class I return from PHP are correctly translated by Flex, but
again, the ArrayCollections are not.

Could this be a problem of AMFPHP 1.9 BETA 2? Maybe Flex does not
recognize an Array as Array.

Well my handler:
public function result(data: Object): void
{
  this.model.productGroups = data.result;
}

But in Debugmode I can see that in data.result the conversion already
failed.
So the Class in data.result is converted, but an ArrayCollection
inside this Class is not.

--- In flexcoders@yahoogroups.com, Kevin <[EMAIL PROTECTED]> wrote:
>
> I am guessing it must be something basic we are overlooking. I have  
> numerous nested VOs and ArrayCollection's of VO's that get returned  
> from PHP with no problem.  As long as both the RemoteClass tag AND  
> the $_explicitType variable are exactly the same and both point to  
> the server location where the VO lives, then everything seems to map  
> correctly.  Here are the things I would check:
> 
> 1) your remote class & explicit type tags.
> 2) are you casting the return from php correctly in Flex  (ie  var  
> myAC:ArrayCollection = new ArrayCollection(data.result as Array) )
> 3) Are your class properties named exactly the same (although this  
> seems to not throw and error even when they aren't exact???)
> 
> Check those and see if any of them solve your problem.  otherwise  
> post your handler code so that we can see how you are handling the  
> results.
> 
> - Kevin



[flexcoders] Re: Coercion failed ArrayCollection with Objects inside Object AMFPHP 1.9

2007-03-22 Thread thuijzer
Yes it contains up to 600 items.

--- In flexcoders@yahoogroups.com, "michael_ramirez44"
<[EMAIL PROTECTED]> wrote:
>
> Does your PHP array contain more then one item when your testing?
> 
> Michael Ramirez
> 
> --- In flexcoders@yahoogroups.com, "thuijzer"  wrote:
> >
> > Whoops, I didn't write this down, but I got this in my code, so it
> > should not be the problem.
> > In fact, all PHP Objects return as Flex Objects, except for Array's.
> > They are not translated to ArrayCollections. So the ArrayCollections
> > in my Flex Objects remain empty.
> > 
> > --- In flexcoders@yahoogroups.com, "michael_ramirez44"
> >  wrote:
> > >
> > > I don't see an $_explicitType variable in your PHP code. You need 
> to 
> > > add the following to you PHP classes.
> > > 
> > > var $_explicitType = "com.app.classes.RemoteClass"; 
> > > var $_explicitType = "com.app.classes.RemoteClassObj"; 
> > > 
> > > 
> > > Michael 
> > > 
> > > --- In flexcoders@yahoogroups.com, Thomas Huijzer  
> > > wrote:
> > > >
> > > > Hi All,
> > > > 
> > > > With AMFPHP 1.9 I am trying to return an Object containing some 
> > > vars and an ArrayCollection. Inside this ArrayCollection there 
> are 
> > > other Objects. But I can't get this to work in Flex.
> > > > For example:
> > > > 
> > > > Flex class
> > > > 
> > > > package com.app.classes
> > > > {
> > > > import mx.collections.ArrayCollection;
> > > > 
> > > > [RemoteClass (alias="com.app.classes.RemoteClass")]
> > > > public class MyClass
> > > > {
> > > > public var id: Number;
> > > > public var list: ArrayCollection;
> > > > }
> > > > }
> > > > 
> > > > package com.app.classes
> > > >  {
> > > > [RemoteClass (alias="com.app.classes.RemoteClassObj")]
> > > >  public class MyClassObj
> > > >  {
> > > >  public var id: Number;
> > > >  public var name: String;
> > > >  }
> > > >  }
> > > > 
> > > >  PHP class
> > > >  
> > > > class MyClass
> > > > {
> > > > var $id;
> > > > var $list;
> > > > }
> > > > class MyClassObj
> > > > {
> > > > var $id;
> > > > var $name;
> > > > }
> > > > function getData()
> > > > {
> > > > $data = new MyClass;
> > > > $data->id = 1;
> > > > $data->list = array();
> > > > $data->list[0] = new MyClassObj;
> > > > $data->list[0]->id = 2;
> > > > $data->list[0]->name = "myName";
> > > > return $data;
> > > > }
> > > > 
> > > > When I return this to Flex, the MyClass is filled ok. By the 
> list 
> > > coercion fails.
> > > > Any idea to solve this problem?
> > > > Thank you.
> > > > 
> > > >  
> > > > -
> > > > Need Mail bonding?
> > > > Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers 
> users.
> > > >
> > >
> >
>




[flexcoders] Re: Coercion failed ArrayCollection with Objects inside Object AMFPHP 1.9

2007-03-21 Thread thuijzer
Whoops, I didn't write this down, but I got this in my code, so it
should not be the problem.
In fact, all PHP Objects return as Flex Objects, except for Array's.
They are not translated to ArrayCollections. So the ArrayCollections
in my Flex Objects remain empty.

--- In flexcoders@yahoogroups.com, "michael_ramirez44"
<[EMAIL PROTECTED]> wrote:
>
> I don't see an $_explicitType variable in your PHP code. You need to 
> add the following to you PHP classes.
> 
> var $_explicitType = "com.app.classes.RemoteClass"; 
> var $_explicitType = "com.app.classes.RemoteClassObj"; 
> 
> 
> Michael 
> 
> --- In flexcoders@yahoogroups.com, Thomas Huijzer  
> wrote:
> >
> > Hi All,
> > 
> > With AMFPHP 1.9 I am trying to return an Object containing some 
> vars and an ArrayCollection. Inside this ArrayCollection there are 
> other Objects. But I can't get this to work in Flex.
> > For example:
> > 
> > Flex class
> > 
> > package com.app.classes
> > {
> > import mx.collections.ArrayCollection;
> > 
> > [RemoteClass (alias="com.app.classes.RemoteClass")]
> > public class MyClass
> > {
> > public var id: Number;
> > public var list: ArrayCollection;
> > }
> > }
> > 
> > package com.app.classes
> >  {
> > [RemoteClass (alias="com.app.classes.RemoteClassObj")]
> >  public class MyClassObj
> >  {
> >  public var id: Number;
> >  public var name: String;
> >  }
> >  }
> > 
> >  PHP class
> >  
> > class MyClass
> > {
> > var $id;
> > var $list;
> > }
> > class MyClassObj
> > {
> > var $id;
> > var $name;
> > }
> > function getData()
> > {
> > $data = new MyClass;
> > $data->id = 1;
> > $data->list = array();
> > $data->list[0] = new MyClassObj;
> > $data->list[0]->id = 2;
> > $data->list[0]->name = "myName";
> > return $data;
> > }
> > 
> > When I return this to Flex, the MyClass is filled ok. By the list 
> coercion fails.
> > Any idea to solve this problem?
> > Thank you.
> > 
> >  
> > -
> > Need Mail bonding?
> > Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.
> >
>




[flexcoders] Re: Coercion failed ArrayCollection with Objects inside Object AMFPHP 1.9

2007-03-21 Thread thuijzer
Kevin, thank you for your response.
Unfortunately it doesn't work. It also seems that this META is only
used for Array's. So I am not sure it will work in my case.

Thomas

--- In flexcoders@yahoogroups.com, Kevin <[EMAIL PROTECTED]> wrote:
>
> you may need to use this meta tag to let Flex know what is in the  
> ArrayCollection
> 
> [ArrayElementType("com.app.classes.MyClassObj")]  //(I am not sure if  
> that is YOUR correct path in Flex??)
> public var list: ArrayCollection;
> 
> I hope that does the trick.  I have gotten it to work in AMFPHP 1.9.
> 
> - Kevin
> 
> 
> 
> On Mar 21, 2007, at 9:42 AM, Thomas Huijzer wrote:
> 
> > Hi All,
> >
> > With AMFPHP 1.9 I am trying to return an Object containing some  
> > vars and an ArrayCollection. Inside this ArrayCollection there are  
> > other Objects. But I can't get this to work in Flex.
> > For example:
> > 
> > Flex class
> > 
> > package com.app.classes
> > {
> > import mx.collections.ArrayCollection;
> >
> > [RemoteClass (alias="com.app.classes.RemoteClass")]
> > public class MyClass
> > {
> >public var id: Number;
> >public var list: ArrayCollection;
> > }
> > }
> >
> > package com.app.classes
> > {
> > [RemoteClass (alias="com.app.classes.RemoteClassObj")]
> > public class MyClassObj
> > {
> >public var id: Number;
> >public var name: String;
> > }
> > }
> > 
> > PHP class
> > 
> > class MyClass
> > {
> > var $id;
> > var $list;
> > }
> > class MyClassObj
> > {
> > var $id;
> > var $name;
> > }
> > function getData()
> > {
> > $data = new MyClass;
> > $data->id = 1;
> > $data->list = array();
> > $data->list[0] = new MyClassObj;
> > $data->list[0]->id = 2;
> > $data->list[0]->name = "myName";
> > return $data;
> > }
> >
> > When I return this to Flex, the MyClass is filled ok. By the list  
> > coercion fails.
> > Any idea to solve this problem?
> > Thank you.
> >
> >
> > Need Mail bonding?
> > Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.
> >
> >
>




[flexcoders] Re: menubar icon

2007-03-02 Thread thuijzer
Is there a way to do this dynamicly?
In my app I don't know what icon's there will be. They are provided by
an CMS-system.
Thank you!



[flexcoders] Delete Components after RemoveChildAction (Flex2)

2007-01-15 Thread thuijzer
After a RemoveChildAction in a Transition I would like to remove the
removed Components from the memory. 
Can someone tell me how this is done best? I am new to Flex and cannot
find anything about this topic.

Thank you.