Manu,
Note the following.
trace(Boolean('TRUE')); // returns true
trace(Boolean('FALSE')); // also returns true
Flex is interpreting the result from your PHP call as a String. Try
returning lower-case 'true' and 'false'. Also, try using:
list[i].aircon as Boolean
instead of:
Boolean(list[i].aircon)
The former will not always convert to true (but will return null if it
can't convert). Lastly, if you can't make it work, just try this
workaround:
vo.aircon = (''+list[i].aircon).toLowerCase()=='true';
-Nick Matelli
Amentra, Inc
--- In [email protected], Manu Dhanda <[EMAIL PROTECTED]> wrote:
>
>
> Code for my Responder, where I am receiving the result:
> public function result(data:Object):void
> {
> //TODO: implement function
> var objList:ArrayCollection = new ArrayCollection();
> var list:ArrayCollection = new
> ArrayCollection(data.result as Array);
> var vo:FlatVO;
> for(var i:int=0; i<list.length; i++){
> vo = new FlatVO();
> vo.userId = int(list[i].userId);
> vo.aircon = Boolean(list[i].aircon);
> objList.addItem(vo);
> }
>
> In here, I supposed to get vo.aircon as boolean[values as true/false for
> different rows/objects in FlatVO]. But, the strange thing is that I am
> receiving all the values for my boolean type as TRUE only.
>
> I had verified on my server side PHP code, and it is returning the
> corresponding values fine [as in TRUE and FALSE accordingly].
>
> I am using WebORB for PHP with Flex. and in there, I had verified in the
> Services as well, that my service returning this object has the right
> values. Then how come I am receiving all the values as TRUE, I can not
> understand this.
>
> Any help will be great.
> Thanks.
>
> Igor Costa-2 wrote:
> >
> > If you paste a part of your code someone here in the list can
answer you
> > but
> > it's hard to get what you really need.
> >
> >
> > Regards
> > Igor
> >
> > On Tue, Jun 3, 2008 at 11:45 AM, Manu Dhanda <[EMAIL PROTECTED]>
> > wrote:
> >
> >>
> >> Hii,
> >>
> >> In short, In Weborb Mgmt Services, I can see the object having a
value of
> >> boolean type correctly.( that is it is returned correctly from
the db).
> >> But when I receive it on Flex side, all is returned as true.
> >>
> >> How should I resolve this?
> >>
> >> Appreciate your time.. to respond it.
> >>
> >> thanks.
> >>
> >> --
> >> View this message in context:
> >>
http://www.nabble.com/Flex-%2B-WebORB-for-PHP%2C-A-very-strage-problem-tp17625304p17625304.html
> >> Sent from the FlexCoders mailing list archive at Nabble.com.
> >>
> >>
> >>
> >
> >
> >
> > --
> > ----------------------------
> > Igor Costa
> > www.igorcosta.com
> > www.igorcosta.org
> >
> >
>
> --
> View this message in context:
http://www.nabble.com/Flex-%2B-WebORB-for-PHP%2C-A-very-strange-problem-tp17625304p17631029.html
> Sent from the FlexCoders mailing list archive at Nabble.com.
>