If you are using ColdFusion for your server, you can return a typed
structure rather than registering the object mappings.  Like this:

 

Struct[__TYPE__] = "com.rottmanj.model.vo.CompanyVO";

 

Jake Churchill
CF Webtools
11204 Davenport, Ste. 100
Omaha, NE  68154
 <http://www.cfwebtools.com> http://www.cfwebtools.com
402-408-3733 x103

From: [email protected] [mailto:[email protected]] On
Behalf Of djhatrick
Sent: Wednesday, May 20, 2009 10:08 AM
To: [email protected]
Subject: [flexcoders] Re: VO Issues

 






I think we'd need to see more code to help you more. Usually, something is
being casted with as and it doesn't match the data type, it will throw null.
I would try removing the class alias, and see what happens. Also, try
calling 

registerClassAlias("com.rottmanj.model.vo.CompanyVO")

In your startup, if that doesn't work, try just populating a generic object.

--- In [email protected] <mailto:flexcoders%40yahoogroups.com> ,
"Jeremy Rottman" <rottmanl...@...> wrote:
>
> I have written a vo that for some odd reason always comes up null when I
try to populate it. Everything I have tried comes up with the same results.
I could use an extra set of eyes to see if there is something small I am
missing.
> 
> Any help with this is greatly appreciated.
> 
> 
> CompanyVO:
> package com.rottmanj.model.vo
> {
> import mx.collections.ArrayCollection;
> 
> [RemoteClass(alias="com.rottmanj.model.vo.CompanyVO")]
> 
> [Bindable]
> public class CompanyVO
> {
> 
> public var company_uuid:String = "";
> public var company_indst:String = "";
> public var company_class:String = "";
> public var description:String = "";
> public var isPriv:Boolean = false;
> public var alt_id:String = "";
> public var entity_name:String = "";
> public var create_who:String = "";
> 
> // address vo 
> 
> public var address_id:String = "";
> public var address1:String = "";
> public var unit_type:String = "";
> public var unit_number:String = "";
> public var address2:String = "";
> public var city:String = "";
> public var state_prov:String = "";
> public var code_zip:String = "";
> public var country:String = "";
> public var type:String = "";
> 
> 
> public function CompanyVO()
> {
> }
> 
> }
> }
> 
> Populating the VO:
> 
> [Bindable] 
> public var companyVO:CompanyVO;
> 
> private function sSelectCompany(event:ListEvent):void
> {
> companyVO = event.itemRenderer.data as CompanyVO
> trace(ObjectUtil.toString(companyVO));
> }
> 
> When a user clicks on a row in a datagrid, sSelectCompany is called via
itemDoubleClick="sSelectCompany(event)". This works perfectly fine. 
> 
> This is the result I get from tracing out the event.itemRenderer.data
> (Object)#0
> address1 = ""
> address2 = ""
> address_id = ""
> alt_id = "ALC05042009_000000000001"
> city = ""
> code_zip = ""
> company_class = "Schol"
> company_indst = "Elect"
> company_uuid = "COM05042009_000000000001"
> country = ""
> create_who = ""
> description = "This is agreat Company"
> entity_name = "Test Company"
> isPriv = 0
> mx_internal_uid = "F1EC080D-498D-9825-761F-5DF5E33C39DF"
> state_prov = ""
> type = ""
> unit_number = ""
> unit_type = ""
> 
> I have tested my coldfusion code and it returns the proper VO. I have
verified that case is not the issue.
> 
> component com.rottmanj.model.vo.CompanyVO
> ADDRESS1 [empty string]
> ADDRESS2 [empty string]
> STATE_PROV [empty string]
> ALT_ID ALC05042009_000000000001
> DESCRIPTION This is agreat Company
> CODE_ZIP [empty string]
> ADDRESS_ID [empty string]
> ISPRIV 0
> CITY [empty string]
> COUNTRY [empty string]
> COMPANY_UUID COM05042009_000000000001
> UNIT_NUMBER [empty string]
> ENTITY_NAME Test Company
> TYPE [empty string]
> COMPANY_INDST Elect
> UNIT_TYPE [empty string]
> COMPANY_CLASS Schol
> CREATE_WHO [empty string]
>



No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.339 / Virus Database: 270.12.34/2122 - Release Date: 05/20/09
06:22:00

Reply via email to