Have you tried to put a breakpoint in order to look in the
debugger the structure of your result?
You might also have a look with ServiceCapture (http://kevinlangdon.com/serviceCapture/).
It's a "must have" tool for debugging
RPC requests.
The result is probably an array.
So you might have to do :
model.categoryList =
new ArrayCollection(event.result);
Benoit Hediard
De : flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] De la part de sufibaba
Envoyé : mardi 18 avril 2006 19:52
À : flexcoders@yahoogroups.com
Objet : [flexcoders] Re: ItemListRenderer Error
Thanks for looking into this.
I am taking another approach to solve this problem. UsingBenoit's PhoneCairngorm configuration. It seems to be working, however,I am getting a compiler error message:
Implicit coercion of a value with static type 'Object' to a possibly unrelated type'mx.collections.ArrayCollection'
Note: the red line in thecode below is the problem. The trace output returns an array ofobjects of type categoryVO.
BTW, I also tried to cast :
model.categoryList = ArrayCollection(event.result) but the same error from the compiler.
---------------------------------------------------------
package com.smartetailing.templateEditor.commands {
import com.smartetailing.templateEditor.model.ApplicationModel;
import com.smartetailing.templateEditor.service.CategoryDelegate;
import com.smartetailing.templateEditor.controller.CategoryListGetEvent;
import com.smartetailing..templateEditor.view.libraryTemplates.*;
import mx.collections.ArrayCollection;
import mx.controls.Alert;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import org.nevis.cairngorm.business.Responder;
import org.nevis.cairngorm.commands.Command;
import org.nevis.cairngorm.control.CairngormEvent;
import org.nevis.cairngorm.view.ViewLocator;
import flash.util.trace;
public class getCategoryListCommand implements Command, Responder {
private static var model:ApplicationModel = ApplicationModel.getInstance();
public function execute(cairngormEvent:CairngormEvent):void {
trace("executeGetCategoryCommand = ")
var event:CategoryListGetEvent = CategoryListGetEvent(cairngormEvent);
var delegate:CategoryDelegate = new CategoryDelegate(this);
delegate.getCategoryList(event.userId);
model.applicationState = Properties.STATE_LOADING;
}
//-------------------------------------------------------------------------
public function onResult(event:ResultEvent):void {
trace("categories = " + event.result)
model.categoryList = event.result;
model.applicationState = Properties.STATE_DEFAULT;
}
//-------------------------------------------------------------------------
public function onFault(event:FaultEvent):void {
Alert.show(event.fault.description + " : " + event.fault.detail, "Errorin getCategoryListCommand");
}
}
}
---------------------------------------------------------
--- In flexcoders@yahoogroups.com, "Matt Chotin" <[EMAIL PROTECTED]> wrote:
>
> The data property is typed as Object so the binding code isn't going to
> know that it can safely read the data. Is your data object strongly
> typed? Maybe you can cast so binding will know what to do.
>
> As for your GetIconFamily binding error, that sounds wrong. Can we see
> the code for that one? Maybe it's a bug.
>
> Matt
>
> -----Original Message-----
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of sufibaba
> Sent: Friday, April 14, 2006 5:17 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] ItemListRenderer Error
>
> Hello Flexors,
>
> I am getting a "binding" error while upgrading a working app from
> Flex2Beta1 to Flex2Beta2.
>
> Below is the code that shows the TileList control with a custom
> ItemListRenderer myThumnail.mxml
>
> ----- Error ------------------------------------------------------
>
> warning: unable to bind to property 'URL' on class 'Object' (class is
> not an IEventDispatcher)
>
> ---------------------
>
> Does anyone know what might be the cause.
>
> Cheers,
>
> Tim
>
>
>
> ------------------- Calling.mxml --------------------------------
> <mx:TileList
> xmlns:mx="http://www.adobe.com/2006/mxml"
>
> dataProvider="{parentApplication.services.SEadminSvc.GetMyTemplates.resu
> lt}"
> width="100%"
> itemRenderer="myThumbnail"
> columnWidth="200"
> height="100%"
> dragEnabled = "false"
> backgroundColor="#C0CCD2"
> creationComplete="InitEvent()"
> >
> </mx:TileList>
>
> ---------------- myThumnail.mxml ---------------------------
>
> <?xml version="1.0"?>
> <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"
> horizontalAlign="center"
> verticalGap="0"
> horizontalGap="0"
> borderStyle=".5"
> width="100"
> height="150"
> >
>
>
> <mx:Metadata>
> [Event("thumbnailClicked")]
> </mx:Metadata>
>
> <mx:Script>
> <![CDATA[
>
> import mx.controls.Alert;
> import flash.events.Event;
>
> public var __templateIdSel:Number;
>
> // Handler function
> private function
> thumbClicked(templateIdSel:Number):void {
> __templateIdSel = templateIdSel;
> this.dispatchEvent(new
> Event('thumbClicked',true)); //
> bubbles set to true
> trace("data.data.URL= ""helloMyMan");
> }
> // Getter functions
> public function get templateIdSel():uint {
> return __templateIdSel;
> }
>
>
> ]]>
> </mx:Script>
>
>
>
> <mx:Zoom id="zoomIn" zoomHeightTo="1.2" zoomWidthTo="1.2"/>
> <mx:Zoom id="zoomOut" zoomHeightTo=".7" zoomWidthTo=".7"/>
>
> <mx:Model id="model">
> <ID>{data.data.ID}</ID>
> </mx:Model>
>
>
> <mx:Label text="{data.data.ID}. {data.label}"
> textAlign="left"
> fontWeight="bold"/>
> <mx:Image
> id="image" x="{image.width/2}" y="{image.height/2}"
> horizontalAlign="center"
> source="http://xKc.seg2.net{data.data.URL}"
> click="thumbClicked(data.data.ID)"
> scaleX=".7" scaleY=".7"
> rollOverEffect="zoomIn"
> rollOutEffect="zoomOut"/>
>
>
> </mx:VBox>
>
> -------------------------------------------------
>
>
>
>
>
>
>
>
> --
> 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
SPONSORED LINKS
Web site design development | Computer software development | Software design and development |
Macromedia flex | Software development best practice |
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.