I am returning a UseraccountVO, and it contains an array of MappedusernameVO(s)
The property "allowed" in every Mappedusername comes into flex as either a 1 or 0. I want flex to convert it to true or false, as they are used for checkboxes.
The VO is setting everything to true. How can I setup the VO so it will convert 0's to false, and 1's to true?
package com.model.vo{ [RemoteClass(alias="com.model.vo.UseraccountVO")] [Bindable] public class UseraccountVO { [ArrayElementType("com.model.vo.MappedusernameVO")] public var Mappedusernames :Array = new Array(); public var id:int = 0; public var userName:String = ''; }}/////////package com.model.vo{ [RemoteClass(alias="com.model.vo.MappedusernameVO")] [Bindable] public class MappedusernameVO { public var userID :int = 0; public var servicesID :int = 0; public var userName :String = ""; public var allowed :Boolean = false; }}
I am sorry. VO stands for Value Object. Immediately when the data is received, it is coerced into the objects I posted above. I tried setting up a constructor that goes
allowed = Boolean(allowed);
But that didn't seem to work unless I did it incorrectly.
hallikpapa
ASKER
I should add, they all come back built already, and the only coercion I do into the value objects is here:
userForm.user = UseraccountVO(note.getBody());
So I believe even if there is a constructor in the Mappedusername, it isn't being called.
Yeah that was my first answer, but the guy who did the backend said just handle it on the flex side. I told him I veto that on the grounds it's stupid, but he was like can you see if you can, so I thought I would at least ask. :)
BTW, what is VO???
CyanBlue
Open in new window