ArrayCollection question in cairngorm

Hi,
I have a simple cfc, the function is like this,it get a
department list
<cffunction name="getDept" displayname="getDept"
access="remote" output="false" returntype="query">
<cfquery name="getDepartment" datasource="bursary">
SELECT Id, Dept
FROM tlkpDept
</cfquery>
<cfreturn getDepartment />
</cffunction>
2.This is the modellocator .I want to save department list to
the acDept (ArrayCollection)
public class BursaryModel implements IModelLocator {
private static var instance:CESFBursaryModel;
public var acDept : ArrayCollection;
3.This is the Delegate function. this builds a flex function
getDept()
public function getDept():void {
var call:Object = this.service.getDept();
call.addResponder(responder);
4.This is part of the command class
public function result( event:Object ):void {
modelLocator.acDept = event.result;
5 the view page, bind the
private var modelLocator:BursaryModel =
CESFBursaryModel.getInstance();
<mx:ComboBox x="440" y="268" width="142"
dataProvider="{modelLocator.acDept}" />
my error is I get a list and it looks like.
[object Object]
[object Object]
[object Object]
[object Object]
but I want to show the dapartment list,Please help me and
give me a hit how to fix this.
I do not know what the event.result is command class and how
to convert is to a real department list.
Thanks for your help
Mark

Hi. I am very new to FLEX, but I had something like this at
one time. I found that if I added .toString(), it work. I was
working with XML at the time.
Gary

Similar Messages

  • Question abourt Cairngorm framework?

    Hi
    I do not understand why we put the following line in main
    page.
    <control:myController id="controller" />
    <business:Services id="services" />
    but no code in main page use the IDs for control and
    business.
    Thanks
    Mark

    These are creating references to your service.mxml object and
    your application controller object that the cairngorm objects use
    in looking up events and executing services.
    The service.mxml file has all the rpc or web service config
    data like:
    <mx:HTTPService id="ControlNavLoadService"
    url="
    http://localhost:8090/febatmon/XML/ControlNav.xml"
    />
    The appController object should extend the FrontController
    and is used as a central repository for event execution like this:
    public class AppController extends FrontController {
    public static const LOAD_CONTROL_NAV_EVENT : String =
    "LOAD_CONTROL_NAV_EVENT";
    public function AppController() {
    addCommand( AppController.LOAD_CONTROL_NAV_EVENT,
    ControlNavLoadCommand );

  • Development AS3 API's under Cairngorm, it's good??

    That is my doubt, it's good to make a as3 api under cairngorm ?.
    Thanks in advice.

    Sorry misunderstood your question.
    Cairngorm is great for implementing MVC and with client communication to the server.
    Thats where its strengths lie.  What it is not extremely strong in is communication between objects within the client.
    If you are going to create api's whose main purpose is to communicate between each other you are better off choosing some other framework.
    Here is a link that compares some of them
    http://www.adobe.com/devnet/flex/articles/flex_framework.html

  • Cairngorm 3 Questions

    In order to use Cairngorm 3 on my project which I would like to do, there are several things I need to know.
    1) When will the Module Library be released?  Right now it is in Beta.
    2) Which parts of Cairngorm have been tested with Parsley 2.3?
    3) Which parts of Cairngorm do/do not work with Parsley 2.3 now?
    4) Which libraries of Cairngorm 3  will be upgraded to Parsley 2.3 and in what timeframe?
    5) Where is the roadmap for Module Library part of Cairngorm?
    I would really like to hear from Adobe on this.
    Thanks

    This is really a question for the folks that are involved in the Cairngorm product. Preferably, people on the Cairngorm team.  If there are other developers that have tried Parsley 2.3 libraries with any of the Cairngorm Libraries I would like to know what your experience has been
    as well.
    Thanks.

  • (HTTPService - result="" - to ArrayCollection) -  a question for super expert ;)

    Firstly look at my example then you will read the question:
    Look at example below - I'm using HTTPService component to retrieve data from SQL database
    (read_record.php is generating nice and tidy xml file with my data)
    <!-- (A) read  -->
    <!-- =================== HTTP SERVICE (read_record) ============================ -->
        <mx:HTTPService id="readTimed"
            url="http://www.pudelek.pl/SCRIPT/A/read_record.php"
            result="patient(event)">
        </mx:HTTPService>
    Then 'result' is calling a function patient() which task is to assign 'event.result'
    to ArrayCollection called 'A_patient_dp'  (this ArrayCollection is a data provider
    for a specific data grid)
    private function patient(event:ResultEvent):void {
        trace("A - PATIENT - loaded...")
        trace(event.result.patient.patient)
        A_patient_dp = event.result.patient.patient
    Everything looks great here, data grid shows all the data from xml file generated
    by read_record.php
    and now is my problem :
    I don't want to display all the data, I want HTTPService to retrieve only particular data
    which are described by variable {parametr} - this var is generated by my application
    I've dond it this way:
    <!-- (A) MAP POSITIONING -->
    <!-- =================== HTTP SERVICE (read_record) ============================ -->
        <mx:HTTPService id="readRequestA"
            url="http://www.pudelek.pl/SCRIPT/A/A_send_read_record.php"
                useProxy="false"
                method="POST">
            <mx:request xmlns="">
                <idstaff>{parametr}</idstaff>
            </mx:request>
        </mx:HTTPService>
    I'm looking into source of 'A_send_read_record.php' in the internet browser and I see
    exact data tree (filtered) which I need.
    The problem here is : how to call function patient(event:ResultEvent) and give it
    data from the event to be assigned to ArrayCollection - like in first example.
    Thanks for all the ideas !!

    If this post answers your question or helps, please mark it as such.
    Greg Lafrance - Flex 2 and 3 ACE certified
    www.ChikaraDev.com
    Flex / AIR Development, Training, and Support Services
    <mx:HTTPService id="readRequestA"
    url="http://www.pudelek.pl/SCRIPT/A/A_send_read_record.php"
    useProxy="false" result="patient(event)" method="POST">
      <mx:request xmlns="">
        <idstaff>{parametr}</idstaff>
      </mx:request>
    </mx:HTTPService>

  • Cairngorm and sockets just a question

    I have recently started to learn Flex and have started to use
    the Cairngorm architecture and was wondering how do sockets come
    into play?
    I understand the whole service request model where you send
    the command along to the service and request the data from the
    remote object, httpservice, etc. However I wanted to use a socket
    to connect to a Java server for a simple learning exercise and I
    was somewhat puzzled as how to do this using the Cairngorm
    architecture .
    The way I had originally thought and implemented and it works
    is to inside the "SocketConnection.as" class when I respond to a
    DataEvent ( ie something coming in on the socket ) I create an
    "Event" which I had registered with the "Front Controller" which
    inturn calls a "Command" which calls a "Delegate" which then
    updates the "Model Locator". So ultimately I seem to be ignoring
    the result and possibly fault aspects of the "Commands" to send and
    receive.
    My overall question is are sockets a viable option in the
    Cairngorm architecture and if so what is the best way to use them?
    Thanks in advance for any responses
    Tomas Pawliuk

    I am looking for something as well. were you able to get it to work?

  • A style question, and a Cairngorm question!

    Style - When I draw on a component with a backgroundColor, why can't I see it?
    Cairngorm -
    Sometimes I want to use the result directly in a module that I am showing on the screen. For instance, when I query the server for a group of items in a category. However, I can not add an event listener to the cairngorm result in the module (view) itself. Is the appropriate way to achieve this:
    1) Dispatch my Event
    2) In the result, populate an arraycollection with the items from the category (using a setter, so I can dispatch event)
    3) In module, listen for said event
    4) Populate tile from this eventhandler
    Is this correct?

    Well it's pretty simple:
    <mx:Canvas id="mainCanvas" backgroundColor="0x000000">
         <mx:creationComplete>
              <[CDATA[
                   var g:Graphics = mainCanvas.graphics;
                   g.beginGradientFill( GradientType.LINEAR, [0xffffff,0xffffff], [1.0,0.0], [0,255], verticalGradientMatrix( 0, 0, mainCanvas.width, mainCanvas.height );
                   g.drawRect( 0, 0, mainCanvas.width, mainCanvas.height );
                   g.endFill();
              ]]>
         </mx:creationComplete>
    </mx:Canvas>
    If I remove the backgroundColor, I can see the gradient. If I leave backgroundColor, I can only see black.

  • Cairngorm/Remoting best practice question

    Is the fault() function of a Cairngorm command meant for ONLY
    for handling failures that aren't expected to happen? (i.e. only
    can be caused as the result of a bug or server problem)
    Can fault() also be used to handle a "normal" error, such as
    doing a search in Active Directory (apparently throws exceptions
    for every ******* thing imaginable) when the search returns no
    results or too many results?
    The way I would think it should work is to only use fault()
    for errors that would be caused by code bugs or server
    malfunctions. (Unexpected exceptions that aren't handled on the
    server, that get passed to FDS/Granite/BlazeDS during a remote
    object call.)
    If something like a login failure (bad password) or a search
    "failure" (no / too many results) happens to throw an exception on
    the server wouldn't you want to catch that exception on the server
    and then return back a "normal" response to Flex via remoting,
    which is then handled appropriately in result()?
    I'm currently in a position where I have to argue this case
    but I'm not making much headway, so could I get some second
    opinions on this one? Am I wrong here? It seems easier to just let
    the exceptions be tossed back to Flex where you can display the
    exception's detailed message, but I don't trust that to be reliable
    and to give decent user-friendly feedback every time.

    Don't use exceptions for flow control.
    so don't throw an exception to tell your client app (flex)
    that something failed.
    rather do this (pseudo code)
    checkName(username, password) {
    try {
    return isuserLogin(username, password);
    } catch(exception) {
    return false;
    ofcourse you can also return more complex objects to tell the
    client application what the reason was why a login was denied, in
    that case return a object rather then a premitive value.
    Ries

  • ArrayCollection field as ComboBox dataProvider question

    I have an ArrayCollection defined like this:
    public var test:ArrayCollection = new ArrayCollection([
    { Id:"one", Amount:2000 },
    { Id:"two", Amount:1000 },
    { Id:"three", Amount:200 } ]);
    And i would like to make 'Id' field of 'test' ArrayCollection
    as dataProvider for a ComboBox compoenent but can't figure it out
    how.I tried with following but get an error:
    comboName.dataProvider = test.Id;
    Can someone please help me with this?
    thanks in advance

    Dang, i totally forgot about 'labelField' property which
    solves the problem:
    comboName.labelField = "Id";
    :)

  • A question on using Cairngorm with flash media server

    Hi,
    I want to use the data from a remote sharedobject on FMS with cairngorm framework.
    Where should I put the service (connection) to the FMS?
    It seems not possible to put it into ServiceLocator.
    This service is quite different from the service of HTTPService, RemoteObjects and WebService.
    It needs a listener to the SyncEvent while the other 3 do not.
    Pls give some hints on how to do this.
    Thx a lot.
    Best
    ChaChaYa

    The IP camera would need to have an embedded RTMP publishing client. I don't know of any IP cameras that have such support, but I suppose it couldn't hurt to check with the manufacturer of the camera to find out if it can be done.

  • Question about ArrayCollections

    Hi,
    Let's say I am using arraycollections...
    and let's say I have
    arraycollection.person_id,
    arraycollection.relationship_type,
    and
    arraycollection.link_to.
    All with tons of records in them.
    If I want to access all the items in say - arraycollection.person_id...
    1. What data_type are those objects?
    2. How do I access them?

    Normally you do not set properties on arrayCollection.  You add items with those properties to arrayCollection, and you can those items can be Object or any Class instance you create.
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • Cairngorm Event Question

    I have an item renderer that is a link.  When it is clicked, I want a grid to be populated with data.  It's not happening.
    Renderer segment:
    public static const CLICK:String = 'UserAARetrieveEvent';
    lb2.addEventListener(MouseEvent.CLICK, retrieveList);
    addChild(lb2);
    public function retrieveList(event:Event):void
    dispatchEvent(new Event(UserAA_NmLk_Renderer.CLICK, true, false));
    Events.as:
    public static const USER_AA_RETRIEVE_EVENT:String = "UserAARetrieveEvent";
    Controller.as:
    addCommand( Events.USER_AA_RETRIEVE_EVENT, UserAARetrieveCommand );
    UserAARetrieveCommand.as will do the execute/result/fault methods if I could get it to execute.

    Simply because the command classes implement ICommand and the
    signature of the method is:
    public function execute( evt : CairngormEvent ) : void
    OO concepts...

  • Basic question related to Cairngorm.

    I have a view in that there is a custom component .View dispatches event that goes through controller to command and to delegate, delegate invokes http service and result comes to command in command I have to remove that particular component and need to add a new component how to do this?
    Thanx,
    Mahesh

    There are many ways of doing it, also depending on the view component you're using. Check out the documentation of the Observer library, section "Reducing View Behaviour" to understand one approach.

  • Problem updating a SOAP Web Service with ArrayCollection

    Hello,
    I am having issues POST'ing an ArrayCollection to a C# Web
    Method. Here's how I have my application set up:
    I have a DataGrid in my application and set the dataProvider
    to be the result object of a Web Service operation. I set the
    DataGrid's editable property to "true" and would like to be able to
    edit the data and send off the DataGrid's dataProvider as the
    parameter for the Web Method. If I edit the first row of the
    DataGrid and trigger the operation, it gets saved just fine. If I
    try to edit any other row this way, it keeps sending the same
    packet (as verified by a packet sniffer) not allowing me to update
    any other row. It seems the Web Service is sending the first 255
    characters of the serialized ArrayCollection.
    My questions are: why is this happening?
    and
    How can I fix this?
    Here is the request of my Web Service operation:
    <mx:request xmlns="">
    <GlossaryTerms>
    {GlossaryArrayCollection}
    </GlossaryTerms>
    </mx:request>
    This is the definition of GlossaryArrayCollection:
    [Bindable]
    public var GlossaryArrayCollection:ArrayCollection = new
    ArrayCollection();
    Here is the SOAP packet that the C# Web Method is expecting:
    <?xml version="1.0" encoding="utf-8"?>
    <soap12:Envelope xmlns:xsi="
    http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="
    http://www.w3.org/2001/XMLSchema"
    xmlns:soap12="
    http://www.w3.org/2003/05/soap-envelope">
    <soap12:Body>
    <GlossaryUpdate xmlns="">
    <GlossaryTerms>
    <Glossary cID="int" cDeleted="boolean" cTerm="string"
    cDefinition="string" cURL="string" cPublic="boolean"
    cRowVersion="string"/>
    <Glossary cID="int" cDeleted="boolean" cTerm="string"
    cDefinition="string" cURL="string" cPublic="boolean"
    cRowVersion="string" />
    </GlossaryTerms>
    </GlossaryUpdate>
    </soap12:Body>
    </soap12:Envelope>
    Thanks to anyone for their help.
    Brian Cary

    Where exactly you are seeing this error? possible for you share the screenshot?
    Execution failed: These policy alternatives can not be satisfied:
    {http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}SupportingTokens

  • A few questions on switching from my powermac G5 to a 17" macbook pro

    Hi, picking up at used macbook pro on monday(Apple MacBook Pro MA611LL/A 17" Notebook PC (2.33 GHz Intel Core 2 Duo, 2 GB RAM, 160 GB Hard Drive, DVD/CD SuperDrive)
    I'm going to use it as my main machine with an external keyboard and mouse hooked up, along with an external 23" cinema display in extended desktop mode. Then when I need to work somewhere else I'll just unplug it and go.
    A few questions from a new macbook user:
    • What's the best way to migrate all my apps, data, photos, etc. Should I use migration assistant? I'm a web designer with dozens of small apps that I may not have the installers for but would like to do a fresh install of the ones I have like CS3. With migration assistant can I just pick some apps to move over, or do they all move over and does it transfer the registration info in case I misplaced certain serial numbers?
    • I'll be selling my desktop, I know you can only install CS3 on one machine, how do I get the CS3 "unactivated" on my Desktop so I can install it on the macbook pro? I own the copy of CS3 and have the dvd's and such.
    • I have a TON of Dreamweaver sites defined, whats the simpleist way to transfer the site info over so I don't have to track down all of that ftp info for every site?
    • I have over a year of Time Machine backups on my current desktop machine, do I transfer those over somehow so my macbook reads them or is it just better to start over with a fresh time machine backup?
    • Will I have any issues with my Iphone or appletv with itunes thinking I'm authorizing a new computer but I'm really only going to be having one machine?
    • The person I'm buying it from is doing a clean install of the system, when I get it should I go ahead and do a fresh Leopard install just to make sure its done properly, and if so is there are there "best practices" on doing that?
    • Any other tips or advice?
    Thanks in advance, I know thats a lot of questions?
    Jeff

    While waiting for responses, I came up with this reload script after a little research. The only major problem is that it makes the entire page blink when it reloads. Any thoughts on improving or completely changing it to get rid of the blink and keeping everything efficient?
    <?xml version="1.0" encoding="utf-8"?>
    <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="1920" height="1080"
    creationComplete="dbTimer()" borderColor="#797979" backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#636363, #9A9A9A]" color="#F3F3F3">
    <mx:Script>
    <![CDATA[
    import mx.controls.Text;
    import mx.controls.Label;
    import mx.collections.ArrayCollection;
    import mx.rpc.events.ResultEvent;
    [Bindable]
    private var omArray:ArrayCollection
    private function resultHandler(event:ResultEvent):void
    omArray = event.result.response.data.row;
    import flash.utils.Timer
    import flash.events.TimerEvent
    import flash.display.Sprite
    private function dbTimer():void
    inventoryService.send();
    var mTimer:Timer=new Timer(1000,10)
    mTimer.addEventListener(TimerEvent.TIMER_COMPLETE,Comple);
    mTimer.start();
    private function Comple(e:TimerEvent):void
    inventoryService.send();
    dbTimer();
    ]]>
    </mx:Script>

Maybe you are looking for

  • Creation of invoicing plan while creating the PO using BAPI_PO_CREATE1

    Hi, basically I'm creating a PO using BAPI_PO_CREATE1 and then creating Invoicing plan thru ME22 using BDC. Could anyone please help me if there is any possibility of creation of invoicing plan while creating the PO itself using BAPI_PO_CREATE1. than

  • XStep- creation of two control recipes

    Hi, I am using the Ecc 6.0 Enp 3.0 I have created a Xtsep structure with parameters and checked. so errors found. XStep is copied into Routing. Production Order is created. during Control recipe generation, there are 2 control recipes are generated.

  • Usage meter counts while charging

    This is my second iphone. My first one would not reach full charge and the usage meter never showed any statistics after a week of use. This phone has been great with a few things wrong, one continues to be the battery meter. When charging sometimes

  • Business Package for SAP SRM 7.0

    Hi All I am looking for the following Bussines Component to Install On portal Where can i get this in service market place Business Package for SAP SRM 7.0        SAP SRM Core        Harmonized Procurement for SAP ERP & SAP SRM (Procurement Business

  • Changing the main frame's center panel

    I have a JPanel that I've added to my application's main frame's content pane's center, i.e. JPanel myPanel = new JPanel (); mainframe.getContentPane().add (myPanel, BorderLayout.CENTER); Then, I'd like to change that panel, and I do the following JP