Thanks for your help with the changes! That did it as well Alex
Benoit, I got a 404 when trying to grab
http://www.benorama.com/flex/samples/PhonesCairngorm2.zip
Also, now it says "Data binding will not be able to detect assignments
to "STATE_LOADING"." in reference to this
<mx:states>
<mx:State name="{STATE_LOADING}">
<mx:SetProperty name="enabled" value="false" />
</mx:State>
</mx:states>
On 4/15/06, Alex Uhlmann <[EMAIL PROTECTED]> wrote:
> Hi Rick
>
> Do you think the error is happening on
>
> > <view:PhoneDetails id="phoneDetails"
> > phone="{phoneList.selectedItem}"
> > width="100%" />
>
> ?
>
> Try uncommenting this to verify. How is phone typed in PhoneDetails? If
> typed as PhoneVO, you'd need to cast selectedItem, which is typed as
> Object to PhoneVO like:
>
> > <view:PhoneDetails id="phoneDetails"
> > phone="{PhoneVO( phoneList.selectedItem )}"
> > width="100%" />
>
>
> Best,
> Alex
>
> Alex Uhlmann
> Consultant (Rich Internet Applications)
> Adobe Consulting
> Westpoint, 4 Redheughs Rigg, South Gyle, Edinburgh, EH12 9DQ, UK
> p: +44 (0) 131 338 6969
> m: +44 (0) 7917 428 951
> [EMAIL PROTECTED]
>
>
> -----Original Message-----
> From: [email protected] [mailto:[EMAIL PROTECTED] On
> Behalf Of Rick Schmitty
> Sent: 15 April 2006 00:52
> To: [email protected]
> Subject: [flexcoders] Cairngorm Phone Selector in F2B2
>
> Hello I'm trying to get the phone selector running on cairngorm 2 and am
> having some problems
>
> After chaning references to http://www.adobe.com/2006/mxml and changing
> ApplicationView.mxml setPropety from <mx:SetProperty property="enabled"
> value="false" /> to <mx:SetProperty name="enabled"
> value="false" /> I also changed PhoneVO.as to implement ValueObject
>
> I now get:
>
> "Implicit coercion of a value with static type 'Object' to a possibly
> unrelated type 'com.mycompany.phones.model:PhoneVO'"
>
>
> Here is the ApplicationView.mxml
>
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml"
> xmlns:view="com.mycompany.phones.view.*"
> currentState="{model.applicationState}"
> height="400"
> layout="horizontal"
> title="Nokia Phone Selector"
> width="700">
>
> <mx:Script>
> <![CDATA[
> import
> com.mycompany.phones.model.ApplicationModel;
> import com.mycompany.phones.model.PhoneVO;
> import
> com.mycompany.phones.controller.PhoneGetEvent;
> import flash.events.Event;
>
> public static var STATE_DEFAULT:String = "";
> public static var STATE_LOADING:String =
> "loading";
>
> [Bindable]
> public var model:ApplicationModel =
> ApplicationModel.getInstance();
> ]]>
> </mx:Script>
>
> <mx:List id="phoneList"
> dataProvider="{model.phones}"
> height="100%"
> labelField="name"
> width="150" />
>
> <view:PhoneDetails id="phoneDetails"
> phone="{phoneList.selectedItem}"
> width="100%" />
>
> <mx:states>
>
> <mx:State name="{STATE_LOADING}">
>
> <mx:SetProperty name="enabled" value="false" />
>
> </mx:State>
>
> </mx:states>
>
> </mx:Panel>
>
>
> And here is the PhoneVO:
>
> package com.mycompany.phones.model {
>
> import org.nevis.cairngorm.vo.ValueObject;
>
> [Bindable]
> [RemoteClass(alias="com.mycompany.phones.model.PhoneVO")]
>
> public class PhoneVO implements ValueObject {
>
> public var name:String;
> public var description:String;
> public var price:Number;
> public var image:String;
> public var series:String;
> public var triband:Boolean;
> public var camera:Boolean;
> public var video:Boolean;
> public var highlight1:String;
> public var highlight2:String;
>
> public function PhoneVO() {
> name = "";
> description = "";
> price = 0;
> image = "";
> series = "";
> triband = false;
> camera = false;
> video = false;
> highlight1 = "";
> highlight2 = "";
> }
>
> }
> }
>
> And here is PhoneVO.cfc
>
> <cfcomponent>
>
> <cfproperty name="name" type="string" default=""> <cfproperty
> name="description" type="string" default=""> <cfproperty name="price"
> type="numeric" default="0"> <cfproperty name="image" type="string"
> default=""> <cfproperty name="series" type="string" default="">
> <cfproperty name="triband" type="boolean" default="false"> <cfproperty
> name="camera" type="boolean" default="false"> <cfproperty name="video"
> type="boolean" default="false"> <cfproperty name="highlight1"
> type="string" default=""> <cfproperty name="highlight2" type="string"
> default="">
>
> <cffunction name="init" output="false"
> returntype="com.mycompany.phones.model.PhoneVO">
> <cfscript>
> this.name = "";
> this.description = "";
> this.price = 0;
> this.image = "";
> this.series = "";
> this.triband = "false";
> this.camera = "false";
> this.video = "false";
> this.highlight1 = "";
> this.highlight2 = "";
> </cfscript>
> <cfreturn this />
> </cffunction>
>
> <cffunction name="populate" output="false" returntype="void">
> <cfargument name="data" type="Struct" />
> <cfscript>
> this.name = data.name;
> this.description = data.description;
> this.price = data.price;
> this.image = data.image;
> this.series = data.series;
> this.triband = data.triband;
> this.camera = data.camera;
> this.video = data.video;
> this.highlight1 = data.highlight1;
> this.highlight2 = data.highlight2;
> </cfscript>
> </cffunction>
>
> </cfcomponent>
>
>
> I can't tell what other object I'm not being strict enough on, anything
> obvious missing?
>
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives:
> http://www.mail-archive.com/flexcoders%40yahoogroups.com
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/