Swapping RemoteObject dataprovider on 2 grids

I'm at a loss, I've searched through the forums and
documentation and the only suggestion to get over this issue is to
run the validateNow() on the grid or the parent panel, neither
resolve my issue.
I can assigne the standard datagrid to a hardcoded array,
swap that hardcoded array with another and it works fine. The
remoteObject swap of dataprovider also works fine. As soon as I
change the standard datagrid to a remote object though one of the
grids to not repaint/refresh. I've also found that only the second
grid will refresh.
private var dataPool:String = "bamdev";
[Bindable] private var myArrayCollection:ArrayCollection;
[Bindable] private var detailTransactionAC:ArrayCollection;
[Bindable] private var dataGridResponder:DataGridResponder =
new DataGridResponder();
private var vantiveAllSql:String = "SELECT * FROM
OAD_VANTIVE_PR_SUM_V";
private var vantiveACSSql:String = "SELECT * FROM
OAD_VANTIVE_PR_SUM_V WHERE APPLICATION_ID IN ('ACS', 'CRM',
'OMS')";
private var transACSSql:String = "SELECT * FROM
OAD_TRANS_TEMP WHERE APPNAME = 'ACS'";
private function runStatement(stmnt:String,type:String):void
var token:AsyncToken =
remoteObj.getDataObjects(stmnt,dataPool);
switch (type) {
case "Vantive":
dataGridResponder.resultHandler = handleResponderResult;
break;
case "DetailTransaction":
dataGridResponder.resultHandler =
handleResponderResultDetailTransaction;
break;
default:
//currentState = "AppDetail_State";
//runStatement(vantiveACSSql);
//Alert.show("vantiveACSSql was run.");
break;
dataGridResponder.faultHandler = handleResponderFault;
// Now we pass the responder to the token that will call the
responder functions when the call to the
// RemoteObject is finished running the RPC
token.addResponder(dataGridResponder);
private function handleResponderResult(ev:ResultEvent):void
myArrayCollection = ev.result.resultset as ArrayCollection;
if (myArrayCollection.length== 0)
vantive_adg.dataProvider = vantiveBlankAC;
else
var g:Grouping = new Grouping();
g.fields = [new GroupingField("APP_TOTAL")];
var gc:GroupingCollection = new GroupingCollection();
gc.source = myArrayCollection;
gc.grouping = g;
gc.refresh();
vantive_adg.dataProvider = gc;
private function
handleResponderResultDetailTransaction(ev:ResultEvent):void
detailTransactionAC = ev.result.resultset as
ArrayCollection;
if (detailTransactionAC.length== 0)
detail_Transactions_dtg.dataProvider =
detailTransactionBlankAC;
else
detail_Transactions_dtg.dataProvider = detailTransactionAC;
private function handleResponderFault(ev:FaultEvent):void
Alert.show(ev.fault.getStackTrace(), "ERROR in
ExampleRemoteObjectUse.handleResponderFault");
public function onCreationComplete():void
runStatement(vantiveAllSql,"Vantive");
private function toggleAppDetail():void
switch (application_cb.selectedIndex) {
case 0:
detail_Transactions_dtg.dataProvider=detailTransactionBlankAC
//detail_Transactions_dtg.validateNow();
//DetailTransaction_pnl.validateNow();
runStatement(vantiveAllSql,"Vantive");
//vantive_adg.validateNow();
//SummVantive_pnl.validateNow()
break;
case 1:
runStatement(vantiveACSSql,"Vantive");
//vantive_adg.validateNow();
//SummVantive_pnl.validateNow()
runStatement(transACSSql,"DetailTransaction");
//detail_Transactions_dtg.dataProvider=appLocalTransactionAC
//detail_Transactions_dtg.validateNow();
//DetailTransaction_pnl.validateNow();
break;
[Bindable]
public var vantiveBlankAC:ArrayCollection = new
ArrayCollection([
{APP_TOTAL:"No Data Available(0)", VANTIVE_NUM:"0",
APPLICATION_ID:"No Data Available",
VAN_NUM_URL:"about:blank",LAST_UPDATE:"N/A", TEMP:"No Data
Available(0)"} ]);
[Bindable]
public var detailTransactionBlankAC:ArrayCollection = new
ArrayCollection([
{TRANSNAME:"No Data Returned",last_update: "N/A",
AVERSPTM:"N/A", AVERSPTMHEALTH:"0", COUNT:"N/A", COUNTHEALTH:"0"},
[Bindable]
public var appLocalTransactionAC:ArrayCollection = new
ArrayCollection([
{TRANSNAME:"Transaction Summary", AVERSPTM:"157",
AVERSPTMHEALTH:"3", COUNT:"527", COUNTHEALTH:"3"},
{TRANSNAME:"IN-Check Compatibility And Set Product",
AVERSPTM:"121", AVERSPTMHEALTH:"4", COUNT:"527", COUNTHEALTH:"5"},
{TRANSNAME:"IN-Check Eligibility Rules", AVERSPTM:"90",
AVERSPTMHEALTH:"4", COUNT:"115", COUNTHEALTH:"3"},
{TRANSNAME:"IN-Create Interaction", AVERSPTM:"151",
AVERSPTMHEALTH:"2", COUNT:"215", COUNTHEALTH:"4"},
{TRANSNAME:"IN-Create Customer", AVERSPTM:"121",
AVERSPTMHEALTH:"4", COUNT:"42", COUNTHEALTH:"2"},
{TRANSNAME:"IN-Get Negotiated Products", AVERSPTM:"90",
AVERSPTMHEALTH:"5", COUNT:"527", COUNTHEALTH:"5"},
{TRANSNAME:"IN-Get Negotiated Assigned Product",
AVERSPTM:"151", AVERSPTMHEALTH:"3", COUNT:"412", COUNTHEALTH:"4"},
{TRANSNAME:"IN-Get Quote", AVERSPTM:"121",
AVERSPTMHEALTH:"4", COUNT:"187", COUNTHEALTH:"2"},
{TRANSNAME:"IN-Get Available Appointments", AVERSPTM:"90",
AVERSPTMHEALTH:"5", COUNT:"10", COUNTHEALTH:"1"},
{TRANSNAME:"IN-Get Customer Details", AVERSPTM:"151",
AVERSPTMHEALTH:"3", COUNT:"127", COUNTHEALTH:"3"},
{TRANSNAME:"IN-Submit Order Action", AVERSPTM:"121",
AVERSPTMHEALTH:"2", COUNT:"112", COUNTHEALTH:"3"},
{TRANSNAME:"IN-Search Customer", AVERSPTM:"90",
AVERSPTMHEALTH:"4", COUNT:"127", COUNTHEALTH:"2"},
{TRANSNAME:"IN-Update Customer", AVERSPTM:"90",
AVERSPTMHEALTH:"5", COUNT:"22", COUNTHEALTH:"3"}
]]>
</mx:Script>

I found my issue, I needed to create an additional
datagridresponder, it must be a one for one for each
datagrid.

Similar Messages

  • TileLayout fails to repaint after swapping dataProvider

    I have a TileLayout on a List with a dataProvider rendering images for me through an itemRenderer.
    I have multiple collections that I'm using on the same list and swapping them out via a button.
    When I do the swap the layout incorrectly updates the display and only shows me the previous height if there was no scroll bar (ie if View 1 has 40 elements and is 4 elements wide and View 2 has 4 elements, when switching from view 2 to view 1 I would only see 4 elements again)
    I tried to update the display by setting the layout again:
    listObj.layout = new TileLayout();
    and this seemed to work. But I was getting some broken images displaying when switching the view. So I added a clear call to the swap:
    listObj.dataProvider.RemoveAll();
    and now I'm back where I started and the view wont update.
    Since there's no force repaint in flash I can't update the view correctly and am stuck.
    Please help,
    Thanks.

    like this?
                   if (objList.dataProvider != null)
                        var data:ListCollectionView = ListCollectionView(objList.dataProvider);
                        data.refresh();

  • 3 cfgrids on one page.  Columns from grid 1,2 and 3 are swapping the first select box from each grid.

    ColdFusion 11, hot fix 3 installed but did not help. There are no binds.
    This one has been driving me crazy and I have finally figured out that it is the first column in each grid where there is a select box via "valuesdisplay" that is the issue. Select box results are switching grids!
    Example of how it is coded to display:
    Grid 1 - gridcolumn should have a dropdown with 1,2,3
    Grid 2 - gridcolumn should have a dropdown with a,b,c
    Grid 3 - gridcolumn should have a dropdown with x,y,z
    However, the results in the dropdowns in the grids are:
    Grid 1 - x,y,z (should be 1,2,3)
    Grid 2 - 1,2,3 (should be a,b,c)
    Grid 3 - a,b,c (should be x,y,z)
    This only happens with the first dropdown for each grid. Any other columns with dropdowns do not have any issues and do not swap out to the wrong grid.
    Sample of my code from the grids:
    Grid 1:
    <cfgrid name = "evalgrid"
      height="200"
      autowidth="no"
      font="arial" fontsize="12"
      query = "getevalfinal"
      SORT="Yes"
      selectmode="edit"
      format="html"
      insert="yes"
      delete = "#deletevalue#">
      <CFGRIDCOLUMN NAME="numberofschools" HEADER="numberofschools"
      HEADERALIGN="LEFT" DATAALIGN="LEFT"
      BOLD="Yes" ITALIC="No"
      SELECT="Yes" DISPLAY="Yes"
      HEADERBOLD="Yes" HEADERITALIC="No"
      VALUES = " ,NA,1,2,D"
      VALUESdisplay = "Blank,NA,1,2,D" valuesDelimiter=","
      width=50>
    </cfgrid>
    Second Grid:'
    <cfgrid name = "SecondGrid"
      height="100" width="700"
      font="arial" fontsize="12"
      query = "getsecurity"
      SORT="Yes"
      selectmode="edit"
      format="html"
      insert="yes"
      delete = "#deletevalue#"
      autowidth="yes"
      >
      <CFGRIDCOLUMN NAME="userrole" HEADER="userrole"
      HEADERALIGN="LEFT" DATAALIGN="LEFT"
      BOLD="Yes" ITALIC="No"
      SELECT="Yes" DISPLAY="Yes"
      HEADERBOLD="YES" HEADERITALIC="No"
      VALUES = "#olduserrole#"
      VALUESdisplay = "#olduserrole#" valuesDelimiter=","
      WIDTH=300
      font="arial" fontsize="12">
    </cfgrid>
    In the above code, userrole values end up being in the wrong grid where numberofschools values should be and vice versa.
    Appreciate any help!
    B.

    You may find this article useful: [http://balusc.blogspot.com/2007/10/populate-child-menus.html].

  • Remote Call to Blazeds and displaying the result set in grid

    Hi,
    I want to call a remote method using Flex application from Blazeds and display the values in DataGrid. Can anyone help in this ?
    -- I am using AMFChannel
    -- The method to be called is PolicyApnVO.getPoliciesApn()
    -- Please advice any correction if required
    Here is the mxml code :
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
                    creationComplete="initApp()" viewSourceURL="srcview/index.html">
        <!--
        Simple client to demonstrate runtime configuration of destinations.
        The "runtime-employee" destination is configured in
        EmployeeRuntimeRemotingDestination.java.
        -->
        <mx:Script>
            <![CDATA[
                import mx.messaging.ChannelSet;
                import mx.messaging.channels.AMFChannel;
                import mx.rpc.remoting.mxml.RemoteObject;
                [Bindable]
                public var srv:RemoteObject;
                public function initApp():void
                    var channel:AMFChannel = new AMFChannel("my-amf", "http://192.168.102.208:8400/policyAnalytics/messagebroker/amf");
                    var channelSet:ChannelSet = new ChannelSet();
                    channelSet.addChannel(channel);
                    srv = new RemoteObject();
                    srv.destination="runtime-policy";   
                    srv.channelSet = channelSet;
                    srv.PolicyApnVO.getPoliciesApn();
            ]]>
        </mx:Script>
        <mx:Panel title="Policy Details" width="100%" height="100%">
            <mx:DataGrid width="100%" height="100%" dataProvider="{srv.PolicyApnVO.getPoliciesApn.lastResult.data.result}"
                         showDataTips="true">
                <mx:columns>
                    <mx:DataGridColumn headerText="APN Id" dataField="apnId"/>
                    <mx:DataGridColumn headerText="APN Name" dataField="apnName"/>
                    <mx:DataGridColumn headerText="Policy ID" dataField="policyId"/>
                    <mx:DataGridColumn headerText="Policy Name" dataField="policyName"/>
                </mx:columns>
            </mx:DataGrid>
        </mx:Panel>
    </mx:Application>

    There may be other ways to do this but here's what I would do:
    1) add a results method to the remote object:
    src.result="onResult(event.result)";
    2) add the callback method: private function onResult(event : * = null)
    :void{
                                                         if(event is
    ArrayCollection)
                                                                myData =
    ArrayCollection(event);
    3) add the variable: private var myData:ArrayCollection;
    4) make the dataProvider for the grid use the my data :
    dataProvider=""
    You can probably avoid all this by adjusting your dataProvider. I am just
    not sure what it would be without experimenting. But definitely not what
    you have. Maybe just {svc.result}.

  • Problem in setting dataprovider for a dynamically generated datagrid

    Hi everybody
    I have a issue in flex, I am generating datagrids dynamically
    by using repeaters but i am unable to set a seperate dataprovider
    for each grid
    Grid1 might come with some set of data and grid 2 with some
    and so on so i want to set dataproviders at runtime for each grid
    how can i do that
    i have pasted my code for generating datagrid dynamically plz
    go thru that and find me some solution
    <mx:Repeater id="ProjectNames"
    dataProvider="{GetTimeSheetDetails.lastResult.NewDataSet.Table1}"
    >
    <mx:Canvas label="{ProjectNames.currentItem.ProjectName}"
    width="100%" height="251" id="CanvasTimeSheet"
    creationComplete="disablecanvas();">
    <mx:DataGrid x="10" y="10" width="864" height="206"
    editable="true"
    dataProvider="{GetTimeSheetDetails.lastResult.NewDataSet.Table}"
    id="dgTimeSheet">
    <mx:columns>
    <mx:DataGridColumn headerText="Task" dataField="TaskName"
    width="60" >
    </mx:DataGridColumn>
    <mx:DataGridColumn headerText="Task Description"
    dataField="TaskDescription" width="150" editable="true"/>
    <mx:DataGridColumn headerText="M" dataField="Monday"
    width="15" editable="true"/>
    <mx:DataGridColumn headerText="T" dataField="Tuesday"
    width="15" editable="true"/>
    <mx:DataGridColumn
    </mx:columns>
    </mx:DataGrid>
    <mx:Label x="564" y="222" text="0" width="35"
    textAlign="right" id="lblMonday" />
    <mx:Label x="602" y="222" text="0" width="33"
    textAlign="right" id="lblTuesday"/>
    </mx:Canvas>
    </mx:Repeater>
    </mx:TabNavigator>

    try this and say me if it works fine!!!
    <html>
    <head>
    <script>
    function fileds() {
         var myParent = document.getElementById('myDiv');
         var text = document.createElement('input');
         text.setAttribute('id', 'myText');
         myParent.appendChild(text);
         document.all.myText.focus();
    </script>
    </head>
    <body>
    <input type="button" onClick="javascript:fileds()" value="Create And Give Focus">
    <br>
    <div id="myDiv"></div>
    </body>
    </html>
    bye

  • Grid populating columns in alphabetical order (which I don't want)

    Hi,
    Am populating a grid from an array defined in my CFC function
    in coldfusion.
    My flex function is as follows:
    public function getOrders(event:ResultEvent):void{
    ords = event.result as ArrayCollection;
    grd.dataProvider = ords;
    The grid is populating nicely without any error. BUT it is
    populating in alphabetical order.
    That is, if in my query I do:
    "select B,D,C,A from tbltest..."
    It is populating the grid columns as "A", "B", "C" and "D"
    (in alphabetical order).
    Any idea, how do I do it to obtain in the order i want , as
    "B","D", "C" and "A".
    Thx for your precious help.

    You will need to specify DataGridColumn tags to define the3
    column order.
    I might be wrong, but I do not think the default order of the
    columns is alphabetical. Rather, it is the reverse of the order
    which the columns are added to the columns array.
    At any rate, the only ways to create reliable column order is
    to use DataGridColumns or to build the columns programmatically.
    Tracy

  • Data Grid Preloader

    Cant seem to get my preloader for a data grid to work. 
    This is my error msg:
    1119: Access of possibly undefined property contentLoaderInfo through a reference with static type flash.net:URLLoader.
    Here is the code so far ...
    var dp:DataProvider;
    var products_xml:XML;
    var xmlLength:Number;
    var xmlReq:URLRequest=new URLRequest("products.xml");
    var xml_loader:URLLoader = new URLLoader();
    function goSection(event:Event):void {
         xxx
         function gridLoad(event:Event):void {
              //load data to data grid
              var instanceName:String=event.target.name;
              var ldr:URLLoader=event.currentTarget as URLLoader;
              var xmlDP:XML=new XML(ldr.data);
              var data:XML=<DATA/>;
              data.setChildren(xmlDP.DATA.(@SECTION == instanceName));
              dp=new DataProvider(data);
              xmlLength=xmlDP.length();
              data_grid.dataProvider=dp;
              //data grid preloader
              preloader_txt.visible=true;
              function Preloader(event:ProgressEvent):void {
                   var percent:Number=Math.round(event.bytesLoaded/event.bytesTotal*100);
                   preloader_txt.text=String(percent)+"%";
                   if (percent==100) {
                        preloader_txt.visible=false;
                        xml_loader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, Preloader);
              xml_loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, Preloader);
         xml_loader.load(xmlReq);
         xml_loader.addEventListener(Event.COMPLETE, gridLoad);
    var PButtons:Array=[b1,b2,b3,b4,b5,b6,b7];
    function addPListeners():void {
         for (var j:uint = 0; j < PButtons.length; j++) {
         PButtons[j].addEventListener(MouseEvent.CLICK, goSection);
    addPListeners();

    now the issue is that the preloader doesnt load the first time i run the goSection function (via MouseClick event), but loads the second time I run the goSection function and everytime after that.  Any suggestions?

  • Nested Objects for a Data Provider in a Data Grid, not displaying data

    Hi, I have a datagrid and the dataprovider for this grid is the result of a RPC call. The result set has the following structure:
    Array
    [0]->Object #1
          [one] => 1
          [two] => 1
          [three] => Object #2
              [apple1] = > Object #3
                  [color] =>    red
                  [rate] => 20
              [apple2] => Object #4 ( the    number of apples is dynamic, apple3,apple4 .. and so on)
                  [color] =>    blue
                  [rate] => 100
    and so on ... so the number of apple objects will vary since its
    dynamic. How do I display this data in a datagrid ??? Please help!! I
    saw many articles on creating the "Nested DataGridColumn " classes...
    like this :
    http://active.tutsplus.com/tutorials/flex/working-with-the-flex-datagrid-and-nested-data-structures/
    it helps, but the problem with my data is that some of the indexes (like  apple1,apple2 etc) are dynamic.
    Also, my flex application is a desktop application (in case that matters). Just to see whats going on, I
    dropped all the nested arrays and used a plain simple one-dimensional array. Even in this case the data
    isnt getting displayed.
    I dont know what im doin wrong. the datafields, labels etc e'thing is correct. I even debugged and
    im getting the result on the flex side. whats going on ?

    No luck ... i converted the result set to a List, and even tried with an iList. Same problem -  nothing gets displayed...
    I have no idea whats happening ....
    This is my code :
    [Bindable]private var privilegesArray:ArrayCollection = new ArrayCollection();
    public function init():void{ // called on creation complete
                    RO.getPrivileges.addEventListener(ResultEvent.RESULT,handleGetPrivileges);
                    RO.getPrivileges();
    protected function handleGetPrivileges(event:ResultEvent):void{
                    privilegesArray = event.result as ArrayCollection;
    <mx:DataGrid id="privilegesDG" dataProvider="{privilegesArray}" width="100%">
            <mx:columns>
                <mx:DataGridColumn headerText="Name" dataField="name" />
                <mx:DataGridColumn headerText="Alias" dataField="alias" />
            </mx:columns>
        </mx:DataGrid>
    The data that gets returned is smthing like this : (for the moment I have removed all the nested objects and arrays and returning just a simple plain array)
    Array => [0] => Object #1
                              [name] => some name
                              [alias] => alias

  • DataGrid's dataProvider change event?

    I've been looking for a dataGrid event which is dispatched when dataProvider property is changed. All I've found was dataChange event, but it concerns only itemRenderers. Is there any way to catch dataProvider when it's changed?

    Hi lbarim,
    You can try ..
    gridDataProvider.addEventListener(CollectionEvent.COLLECTION_CHANGE, onDataProviderChange);
    private function onChange(event:CollectionEvent):void
    Note: Here gridDataProvider is an ArrayCollection which is a dataProvider for your Grid.
    Thanks,
    Bhasker

  • Special characters into datagrid through the use of buttons

    Hi!
    I have a datagrid for word input, I'm trying to create a "special characters" panel, kind of like google's new "virtual keyboard" thing on google.com, so that the user can enter data into the datagrid cells using characters that aren't on their keyboards.
    I manage to do this just fine, using the solution below. I know this is probably not the best/most effective way to do this, so any suggestions for making the code better will be appreciated. I only started using Flex a month ago.
    grid.addEventListener(DataGridEvent.ITEM_EDIT_BEGIN, selectColumn)
    function selectColumn(event:DataGridEvent):void
    var selectedColumn:DataGridColumn = grid.columns[event.columnIndex];
    selCol = selectedColumn.dataField;
    //The function for adding a special character to the selected datagrid column by clicking a button:
    //(inputWordArray is the dataprovider for the grid called "grid" )
    protected function clickSomeButton(event:MouseEvent):void
    var colIndex:int = new int;
    if (selCol == "from"){
    inputWordArray[grid.selectedIndex].from = inputWordArray[grid.selectedIndex].from + "æ";
    colIndex = 0;
    else if (selCol == "to"){
    colIndex = 1;
    inputWordArray[grid.selectedIndex].to = inputWordArray[grid.selectedIndex].to + "æ";
    inputWordArray.refresh();
    grid.dispatchEvent(new DataGridEvent(DataGridEvent.ITEM_EDIT_BEGINNING, false, false, colIndex, null, grid.selectedIndex));
    The problem is that this only adds a letter at the end of the selected item's value, not at a specific position within the word specified by the position of the cursor. This is what I need to achieve. I have no idea even what to search for, if anyone could please give me a hint that'd be great.

    You will probably need to capture the editor's selectionBeginIndex and
    selectionEndIndex

  • How to change datagrid contents?

    Okay it is easy to follow the tutorials and populate a
    datagrid like:
    <mx:DataGrid id="dgmain">
    <mx:columns>
    <mx:DataGridColumn headerText="header1" dataField="col1"
    />
    <mx:DataGridColumn headerText="header1" dataField="col2"
    />
    <mx:DataGridColumn headerText="header1" dataField="col3"
    />
    </mx:columns>
    <mx:ArrayCollection id="arrcol">
    <mx:Array id="arr1">
    <mx:Object col1="cell 11" col2="cell12" col3="cell 13"
    />
    <mx:Object col1="cell 21" col2="cell22" col3="cell 23"
    />
    </mx:Array>
    </mx:ArrayCollection>
    </mx:DataGrid>
    But how do you update a cell value, for instance cell in row
    1 coulumn 2 where i want to replace "cell12" with "new value" ?
    Another thing: i want to get data from a sql-server by using
    a webservice or something so perhaps there is another more easy way
    to populate and update a datagrid or accordion?

    Your underlying array collection (that will be the
    dataprovider for the grid)
    should be declared with the bindable metatdata tag
    [Bindable]
    private var mydata:ArrayCollection
    Now Flex we do all the data binding you need.
    Now you can make the datagrid editable, or more likely
    capture the click or change events in the grid, get the selected
    row, poputate a editor panel (again using data binding so Flex will
    do all the work).
    For example, suppose you have a collection of Employee
    Objects:
    [Bindable]
    private var employees:ArrayCollection;
    [Bindable]
    private var selectedEmployee:Employee

  • Flash Islands : convert bindable ArrayCollection

    Hi Experts,
    I'd like to use a Flex calendar component in a Flash Island in my WDA application.
    I've created a node (EVENTS) with 3 attributes (STARTTIME, ENDTIME, SUMMARY) and created a GACDataSource (calendarEvents) with 3 GACProperties (startTime, endTime, summary). Then I've created some bindable variables in my Flex application :
    [Bindable]
    public var calendarEvents:ArrayCollection;
    [Bindable]
    public var startTime:String;
    [Bindable]
    public var endTime:String;
    [Bindable]
    public var summary:String;
    If I put a DataGrid in my Flex application and use calendarEvents as dataProvider everything works fine and the data is displayed in the grid :
    <mx:DataGrid dataProvider="{calendarEvents}" id="grid">
         <mx:columns>
              <mx:DataGridColumn headerText="Start" dataField="{startTime}"/>
              <mx:DataGridColumn headerText="End" dataField="{endTime}"/>
              <mx:DataGridColumn headerText="Summary" dataField="{summary}"/>
         </mx:columns>
    </mx:DataGrid>
    However, if I use calendarEvents as dataProvider for the calendar component, the events are not displayed on the calendar. This component expects an ArrayCollection that looks like :
    [Bindable] public var eventsArray:ArrayCollection = new ArrayCollection([
    {startTime: "2011/03/10 00:00", endTime: "2011/03/11 00:00", summary: "Meeting"}]);
    The problem is the calendarEvents ArrayCollection contains WDContextNode objects. How do I convert this ArrayCollection to an ArrayCollection that can be understood by the calendar component?
    Regards,
    Pierre

    Problem solved by specifying calendar data with custom functions.
    Pierre

  • Datagrid refresh problem?

    fileListArray.refresh();
    dg_curtainmanager.invalidateList();
    dg_curtainmanager.invalidateDisplayList();
    <mx:DataGrid id="dg_curtainmanager" showHeaders="true"  editable="true"  includeInLayout="false" dataProvider="{fileListArray}"  creationComplete=""  variableRowHeight="true"   wordWrap="true"  rowCount="{fileListArray.length}"  width="100%"  >
    <mx:DataGridColumn  headerText="Parent Folder"  sortable="true"  editable="false"   width="250" minWidth="65" wordWrap="true" >
                            <mx:itemRenderer>
                                <fx:Component>
                                    <mx:HBox width="100%"
                                             horizontalAlign="left" verticalAlign="middle">
                              <mx:Image source="@Embed(source='images/edit_16.gif')"  toolTip="Select Starting Folder" buttonMode="true" click="outerDocument.parentfolderimagclick()" />
                                        <mx:Label text="{data.document_folder_name}" color="black" />   
                                    </mx:HBox>
                                </fx:Component>
                            </mx:itemRenderer>
                            </mx:DataGridColumn>
    </mx:DataGrid>

    @welcomecan,
    What refresh problem you are facing.. in DataGrid? When you change your DataProvider for your grid the values are not being changed or somethingelse..??
    Please always be clear in explaining your problem in order to get it resolved..
    Thanks,
    Bhasker

  • How to make animations less chopy? opinions, advice require

    Hi guys ive been using flex now for about 2 years. Love flex dont have to much to  complaint about it is  extremely flexible however i have one simple question that i just dont quite understand and im hoping someone here can shed some light. Picture this. I have a grid and a call to a webservice. when i click on the grid item it makes a call to the webservice once the webservice returns the array of items i  want to play an animation. But what i have noticed is that at the point the dataprovider is assign to the grid  the application basically freezes. This is due to the fact that by assining the dataprovider to the grid flex internally is looping the colletction and passing it to the grid. Well if you are trying to play and animation while the dataprovider is being assignt the animation gets choppy... is there any techniques around this? I would really love to hear about how other people have overcomed this challenge or I'm i the only idiot thats dealing with this.
    Any responses would be greatly appreciated.
    Thanks
    Miguel

    If you use XML to get data from the server, then unmarshalling of data to create objects takes a heavy toll on the processor.
    If you use Blaze DS or LCDS, deserialization from binary data is a breeze and it doesn't hit the processor as much.
    Now, if you don't want to change your service, consider using TimeSlicing:
    http://cookbooks.adobe.com/post_Time_slicing-18691.html
    Good read about the Flash Player "elastic racetrack":
    http://www.craftymind.com/2008/04/18/updated-elastic-racetrack-for-flash-9-and-avm2/

  • Error while compiling charts

    Hi,
    I am new to the flex . Started using today. I just tried to compile the following code using command line.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="top"
        horizontalAlign="center" backgroundGradientColors="[0x000000,0x323232]" paddingTop="0" viewSourceURL="srcview/index.html">
        <mx:Script>
            <![CDATA[
            import mx.collections.ArrayCollection;
            [Bindable]
            private var expensesAC:ArrayCollection = new ArrayCollection( [
                { Month: "Jan", Profit: 2000, Expenses: 1500, Amount: 450 },
                { Month: "Feb", Profit: 1000, Expenses: 200, Amount: 600 },
                { Month: "Mar", Profit: 1500, Expenses: 500, Amount: 300 },
                { Month: "Apr", Profit: 1800, Expenses: 1200, Amount: 900 },
                { Month: "May", Profit: 2400, Expenses: 575, Amount: 500 } ]);
            ]]>
        </mx:Script>
        <mx:Panel title="AreaChart Control" layout="horizontal" color="0xffffff" borderAlpha="0.15" width="600" height="240"
             paddingTop="10" paddingRight="5" paddingBottom="10" paddingLeft="5" horizontalAlign="center">
            <mx:AreaChart id="Areachart" color="0x323232" height="100%"
                 showDataTips="true" dataProvider="{expensesAC}">
                <mx:horizontalAxis>
                    <mx:CategoryAxis categoryField="Month"/>
                </mx:horizontalAxis>
                <mx:series>
                    <mx:AreaSeries yField="Profit" form="curve" displayName="Profit"/>
                    <mx:AreaSeries yField="Expenses" form="curve" displayName="Expenses"/>
                    <mx:AreaSeries yField="Amount" form="curve" displayName="Amount"/>
                </mx:series>
            </mx:AreaChart>
            <mx:Legend dataProvider="{Areachart}" color="0x323232"/>
        </mx:Panel>
    </mx:Application>
    The command was ' mxmlc chart1.mxml '
    But i got the following compile time error :
    D:\sudeepcm\Frame Works\Adobe Flex\Study\Charts\chart1.mxml(23):  Error: Type was not found or was not a compile-time constant: AreaChart.
            <mx:AreaChart id="Areachart" color="0x323232" height="100%"
    I am using flex_sdk_3.5 and jdk 1.6. Pls help me.
    Thanks  in advance for ur help.

    hi iam new to flash builder i have mxml file and want to build swf application but an error occur please help me in this regard.
    error is " Error: Initializer
    for 'horizontalAxis': values of type mx.charts.chartClasses.IAxis cannot be rep
    resented in text.
       <mx:LineChart id="myChart" showDataTips="true" width="578" heigh  t="290" x="0" y="0" horizontalAxis="_TrenVUR_CategoryAxis1_c()" series="  [_TrenVU R_LineSeries1_i()]" color="#001f85a7"  dataProvider='{myData}'/> "
    the mxml file code is as follow.
    <?xml version="1.0" encoding="UTF-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" width="649" height="502" viewSourceURL="srcview/index.html" creationComplete="{InitTrend();}">
        <mx:Script><![CDATA[
             //Warning: in this unregistered version, no Flex Script will be  generated while exporting the Flex Project. Please purchase the full  version to get Flex Script at http://www.sothink.com/product/flashdecompiler/index.htm.
        ]]></mx:Script>
        <mx:Panel title="Trend Viewer" width="598" height="453" layout="absolute">
             <mx:LineChart id="myChart" showDataTips="true" width="578"  height="290" x="0" y="0" horizontalAxis="_TrenVUR_CategoryAxis1_c()"  series="[_TrenVUR_LineSeries1_i()]" color="#001f85a7"  dataProvider='{myData}'/>
            <mx:Grid id="frm" width="568" x="0" y="298" height="58">
                <mx:GridRow width="100%" height="100%">
                    <mx:GridItem width="77" height="100%">
                        <mx:Label text="Starting Date" textAlign="right"/>
                    </mx:GridItem>
                    <mx:GridItem width="100%" height="100%">
                        <mx:Label text="Day:"/>
                        <mx:ComboBox id="ddlDays" dataProvider='{arrDays}'/>
                    </mx:GridItem>
                    <mx:GridItem width="100%" height="100%">
                        <mx:Label text="Month:"/>
                        <mx:ComboBox id="ddlMonths" dataProvider='{arrMonths}'/>
                    </mx:GridItem>
                    <mx:GridItem width="101" height="100%">
                        <mx:Label text="Year:"/>
                        <mx:ComboBox id="ddlYear" dataProvider='{arrYears}'/>
                    </mx:GridItem>
                </mx:GridRow>
                <mx:GridRow width="100%" height="100%">
                    <mx:GridItem width="100%" height="100%">
                        <mx:Label text="Ending Date"/>
                    </mx:GridItem>
                    <mx:GridItem width="100%" height="100%">
                        <mx:Label text="Day:"/>
                        <mx:ComboBox id="ddlDaysE" dataProvider='{arrDays}'/>
                    </mx:GridItem>
                    <mx:GridItem width="100%" height="100%">
                        <mx:Label text="Month:"/>
                        <mx:ComboBox id="ddlMonthsE" dataProvider='{arrMonths}'/>
                    </mx:GridItem>
                    <mx:GridItem width="100%" height="100%">
                        <mx:Label text="Year:"/>
                        <mx:ComboBox id="ddlYearE" dataProvider='{arrYears}'/>
                    </mx:GridItem>
                </mx:GridRow>
            </mx:Grid>
            <mx:Grid x="134" y="364" height="25" width="371">
                <mx:GridRow width="100%" height="100%">
                    <mx:GridItem width="40" height="100%">
                        <mx:Label text="Prob:"/>
                    </mx:GridItem>
                    <mx:GridItem width="157" height="23">
                        <mx:ComboBox id="ddlProb" dataProvider='{arrProbs}'/>
                    </mx:GridItem>
                    <mx:GridItem width="100%" height="100%"/>
                </mx:GridRow>
            </mx:Grid>
            <mx:Grid x="69" y="388" height="25" width="436">
                <mx:GridRow width="100%" height="100%">
                    <mx:GridItem width="182" height="100%"/>
                    <mx:GridItem width="100%" height="23">
                        <mx:Button id="btnOK" label="OK" click="{Func_OK();}"/>
                    </mx:GridItem>
                    <mx:GridItem width="100%" height="100%"/>
                </mx:GridRow>
            </mx:Grid>
        </mx:Panel>
    </mx:Application>
    regards mazhar

Maybe you are looking for