Item renderer question

I have an item renderer that adds a checkbox to my tree and
checks it. My problem is that when i uncheck the box and scroll
down the tree there are random boxes that are unchecked. Does
anyone know how to get around this? Here is the renderer, and any
help would be greatly appreciated!!
package components
import mx.core.Container;
import mx.core.IDataRenderer;
import mx.controls.CheckBox;
import mx.controls.treeClasses.*;
import mx.collections.*;
import flash.xml.*;
import flash.events.Event;
import flash.events.MouseEvent;
import mx.controls.Alert;
import mx.controls.listClasses.*;
public class myTreeItemRenderer extends TreeItemRenderer
private var nodeType:String;
// myCheckBox: holds the CheckBox we are adding to the tree
nodes
protected var myCheckBox:CheckBox;
// set the margin between the image we are adding, and the
label
private var cbToLabelMargin:Number = 2;
// show default branch icon?
private var showDefaultBranchIcon:Boolean = false;
// show default leaf icon?
private var showDefaultLeafIcon:Boolean = false;
public function myTreeItemRenderer()
super();
// InteractiveObject variables.
mouseEnabled = false;
public function openBranch(evt:Event):void
// get the TreeListData
var myListData:TreeListData = TreeListData(this.listData);
// get the selected node
// var selectedNode:Object = myListData.node;
var selectedNode:Object = myListData.item;
var selectedNodeXML:XMLList = new XMLList(selectedNode);
// get the tree that owns us
var theTree:Tree = Tree(myListData.owner);
// find out if the selected branch is already open
//var isBranchOpen:Boolean = theTree.getIsOpen( selectedNode
//mx.controls.Alert.show(selectedNode.toString());
// if the selected branch is open, let's close it
// and if it's closed, let's open it
//var isBranchOpen:Boolean = isBranchOpen ? false : true;
//theTree.setIsOpen( selectedNode, isBranchOpen, true, false
if(theTree.id=="soTree")
this.parentApplication.soCheckBoxChanged(evt,selectedNodeXML);
//mx.controls.Alert.show(selectedNodeXML.attribute('id')+"
"+selectedNodeXML.attribute('type')+" False");
else if(theTree.id=="ntaTree")
override protected function createChildren():void
// create a new CheckBox() to hold the CheckBox we'll add to
the tree item
myCheckBox = new CheckBox();
myCheckBox.setStyle( "verticalAlign", "middle" );
myCheckBox.selected=true
// and apply it to the tree item
addChild(myCheckBox);
// add the event listener to the whole tree item
// this will let us click anywhere on the branch item to
expose the children of this branch
myCheckBox.addEventListener( MouseEvent.CLICK, openBranch );
super.createChildren();
override public function set data(value:Object):void
if(value==null)
return;
else
super.data = value;
// get the tree that owns us
var _tree:Tree = Tree(this.parent.parent);
// if the current node is a branch node
if(TreeListData(super.listData).hasChildren)
// set styles...
setStyle("color", 0x000000);
setStyle("fontWeight", 'bold');
// if we don't want to show the default branch icons, let's
empty them
if( !showDefaultBranchIcon )
_tree.setStyle("folderClosedIcon", null);
_tree.setStyle("folderOpenIcon", null);
else
// if we are in here, then the current node is a leaf node
// set styles...
setStyle("color", 0x000000);
setStyle("fontWeight", 'normal');
// if we don't want to show the default leaf icons, let's
empty them
if( !showDefaultLeafIcon )
_tree.setStyle("defaultLeafIcon", null);
override protected function
updateDisplayList(unscaledWidth:Number,unscaledHeight:Number):void
super.updateDisplayList(unscaledWidth, unscaledHeight);
if(super.data)
// if the current node is a branch
if(TreeListData(super.listData).hasChildren)
// get the current node and it's children as XMLList
// var currentNodeXMLList:XMLList = new
XMLList(TreeListData(super.listData).node);
var currentNodeXMLList:XMLList = new
XMLList(TreeListData(super.listData).item);
nodeType= currentNodeXMLList.attribute('type');
// get the number of children under the current node
var numOfImmediateChildren:int =
currentNodeXMLList[0].children().length();
// set the image to be displayed in the branches
//myImage.source = branchImage;
// set the label text
super.label.text = TreeListData(super.listData).text + "(" +
numOfImmediateChildren + ")";
else
// if we are in here, then the current node is a leaf node
//myImage.source = leafImage;
// reset the position of the image to be before the label
myCheckBox.x = super.label.x;
// reset the position of the label to be after the image,
plus give it a margin
super.label.x = myCheckBox.x + 10 + cbToLabelMargin;
}

Hi,
The links you have refered are really useful. Unfortunatelly, my environment is just flex sdk 3.
So I have to find some other solution to finish this logic.
Nith

Similar Messages

  • This.includeInLayout function in AdvancedDataGridColumn item renderer question

    I can't seem to do this:
    <mx:AdvancedDataGridColumn headerText="Received" width="120"  backgroundColor="{CommonFunctions.LIGHT_ORANGE}"  >
                        <mx:itemRenderer >
                            <mx:Component>
                                <mx:HBox horizontalScrollPolicy="off"  >
                                    <mx:Script>
                                        <![CDATA[
                                            override public function set data(value:Object):void
                                                super.data=value;
                                                if (value != null)
                                                    this.visible =  this.data.tradeType != 'V';
                                                    this.includeInLayout =  this.data.tradeType != 'V';
    the Hox doesn't dissapear when
    this.data.tradeType != 'V';                  
    Any ideas friends?

    I also tried this but no effect
        <mx:AdvancedDataGridColumn backgroundColor="{CommonFunctions.LIGHT_ORANGE}" id="depositPaidDate" dataField="deposit" headerText="Deposit paid" width="70" rendererIsEditor="true">
                        <mx:itemRenderer>
                            <mx:Component>
                                <mx:DateField formatString="DD/MM/YYYY" textInputStyleName="white" textAlign="center" visible="{data.tradeType != 'V'}">
                                </mx:DateField>
                            </mx:Component>
                        </mx:itemRenderer>
                    </mx:AdvancedDataGridColumn>
    However when wrapped in a Hbox then this works:
    I can't seem to see the difference, maybe this.visible doesn't do anything in the first example
    <mx:AdvancedDataGridColumn headerText="Received" width="120"  backgroundColor="{CommonFunctions.LIGHT_ORANGE}"  >
                        <mx:itemRenderer >
                            <mx:Component>
                                <mx:HBox horizontalScrollPolicy="off"  >
                                    <mx:Script>
                                        <![CDATA[
                                            override public function set data(value:Object):void
                                                super.data=value;
                                                if (value != null)
                                                    ti.visible =  this.data.tradeType != 'V';
                                                    ti.includeInLayout =  this.data.tradeType != 'V';
                                                    cb.visible =  this.data.tradeType != 'V';
                                                    cb.includeInLayout =  this.data.tradeType != 'V';
                                        ]]>
                                    </mx:Script>
                                    <mx:ComboBox  id="cb" dropdownStyleName="dropdown" prompt="---">
                                        <mx:change>
                                            <![CDATA[
                                            this.data.deposit = cb.selectedLabel;
                                            this.data.isModified = 1;
                                            ]]>
                                        </mx:change>
                                    </mx:ComboBox>
                                    <mx:TextInput width="100%" backgroundColor="#ffffff" textAlign="right" borderStyle="inset" restrict=".0-9" maxChars="11" id="ti">
                                    </mx:TextInput>
                                </mx:HBox>
                            </mx:Component>
                        </mx:itemRenderer>
                    </mx:AdvancedDataGridColumn>

  • How to overlap datagrid colums line with item renderer

    Hello guys I been stuck for a few days now and I'm wondering if there is a better way to do this.
    I put an item renderer on a column of the datagrid. The renderer basically expands the column height and shows some controls.
    Im using a border container as the container that is holding the items in the grid. However what I would like to do is make the border container as big as the grid with a plus sign button. and then basically hide that  rows vertical grid lines.
    i tried setting the depth eventhought i understant this is not a spark grid i though it should work but it does not. Any tip or direction would be greatly appreciated.
    Miguel

    ok i answered my own question. what i need to do is use the advance datagrid. Then set these properties.
    <mx:AdvancedDataGrid defaultLeafIcon="{null}"
                             folderClosedIcon="{null}"
                             folderOpenIcon="{null}"
                             disclosureClosedIcon="@Embed(source='assets/plusSign.png')"
                             disclosureOpenIcon="@Embed(source='assets/plusSign.png')">
    Message was edited by: miguel8312

  • How do you measure performance of an item renderer?

    I'm creating an ItemRenderer in Flex 4.6 and I want to know how to measure total time to create, view and render an item renderer and how long it takes to view and render that item renderer when it's being reused.
    I just watched the video, Performance Tips and Tricks for Flex and Flash Development and it describes the creation time, validation time and render time and also the reset time. This is described at 36:43 and 40:25.
    I'm looking for a way to get numbers in milliseconds for total item renderer render time and reset time (what is being done in the video). 

    To answer your first question, in this video Ryan Frishberg recommends measuring and tuning your code. I'm trying to follow his example for my own item renderers.
    I've taken some key slides out to show you.

  • When to use Drop In Item renderer and InLine Item Renderers ??

    Hi ,
    I am getting confused in where to use Inline ItemRenderer and DropIn Item Renderer .
    What i feel is that DROP in Item Renderer are easy to use , and those can satisfy any requirements .
    What i read from tutorilas that we cant use Drop In because they say ,  The only drawback to using  drop in is that them is that you cannot configure them
    Please help me .

    Hi Kiran,
    Here is the detailed explanation you needed:
    You can also refer the link below:
    http://blog.flexdevelopers.com/2009/02/flex-basics-item-renderers.html
    Drop-In Item Renderers
    Drop-In Item Renderers are generic in nature and don't rely on specific data fields to render data. This allows them to be used with a wide range of data sets, hence, the term “drop-in”. Drop-In Item Renderers can be “dropped-in” to any list-based control regardless of the dataprovider’s data properties.
    In our previous example, the employee photo property requires use of a custom Item Renderer to render properly in the UI. In this scenario the Image component satisfies our rendering needs out of the box. Implemented as a Drop-In Item Renderer, the Image component takes any data property regardless of name and uses it as the Image component's source property value. Assuming our employee photo property contains a valid image path, the Image Drop-In Item Renderer will work perfectly and resolve the image path as an image in the UI.
    <!-- Drop-in Item Renderer: Image control -->
    <mx:DataGridColumn dataField="photo"
                       headerText="Employee Photo"
                       itemRenderer="mx.controls.Image"/>
    Drop-In Item Renderers are simple and easy to use and satisfy specific use cases nicely. However, they provide no flexibility whatsoever. If your needs are not satisfied by a Drop-In Item Renderer, you must create your own Item Renderer as an inline component or an external component.
    Inline Item Renderers
    Generally used for simple item rendering requiring minimal customization, inline Item Renderers are defined as a component nested within the MXML of your list-based control.
    It is important to note that Item Renderers nested within the itemrender property of a list-based control occupy a different scope than the list-based control. Any attempt to reference members (properties or methods) of the parent component from the nested Item Renderer component will result in a compile-time error. However, references to the members of the parent component can be achieved by utilizing the outerDocument object.
    <mx:DataGrid id="myGrid" dataProvider="{gridData}">
       <mx:columns>
          <mx:DataGridColumn headerText="Show Relevance">
             <mx:itemRenderer>
                <mx:Component>
                   <mx:Image source="{'assets/images/indicator_' + data.showRelevance + '.png'}"
                             toolTip="{(data.showRelevance == 1) ? 'On' : 'Off'}"
                             click="outerDocument.toggle()" />
                </mx:Component>
             </mx:itemRenderer>
          </mx:DataGridColumn>
       </mx:columns>
    </mx:DataGrid>
    Remember, rules of encapsulation still apply. Mark all properties or methods public if you want them accessible by your inline Item Renderer. In the previous example, the toggle() method must have a public access modifier to expose itself to the inline Item Renderer.
    public function toggle():void
    Inline Item Renderers can also be reusable by creating a named component instance outside of the list-based control. This component must have an id property and contain the rendering logic of the Item Renderer. Using data bindings, the component is assigned to the itemrenderer property of one or more data properties of a list-based control.
    <!-- Reusable inline Item Renderer -->
    <mx:Component id="ImageRenderer">
       <mx:VBox width="100%" height="140"
                horizontalAlign="center" verticalAlign="middle">
          <mx:Image source="{'assets/'+data.image}"/>
          <mx:Label text="{data.image}" />
       </mx:VBox>
    </mx:Component>
    <!-- Used within a list-based control-->
    <mx:DataGridColumn headerText="Image"
                       dataField="image" width="150"
                       itemRenderer="{ImageRenderer}"/>
    In the previous example, note that the Item Renderer component contains 2 UI controls – Image and Label. When using multiple controls within an Item Renderer, a layout container is required. In this example, a VBox was used.
    If this post answers your question or helps, please kindly mark it as such.
    Thanks,
    Bhasker Chari
    Message was edited by: BhaskerChari

  • Item renderer for specific rows

    I need to have a checkbox item renderer for a spark datagrid column. I am using the following to get an item renderer into column:
    var checkBoxRenderer:ClassFactory = new ClassFactory(GridCheckBoxItemRenderer);
    column.itemRenderer = checkBoxRenderer;
    My question is if I need to show a checkbox for specific rows can I do that without going into GridCheckBoxItemRenderer's source code?
    Thanks

    Hi Zolotoj ,
    Please go through following links :
    http://stackoverflow.com/questions/1952940/show-itemrenderer-in-specific-datagrid-rows-oth ers-empty
    http://www.flexer.info/2009/01/09/different-rows-in-datagrid-programmatically-added-itemre nderers-classfactory-and-ifactory/
    It will provide you some idea to how to proceed further for this problem.
    Thanks and Regards,
    Vibhuti Gosavi | [email protected] | www.infocepts.com

  • Datagrid item renderer delete button

    I have a datagrid with an item renderer. In the item renderer
    is a delete button img. Onclick it will remove the item from the
    datagrid with the exception of the first item. I am using outer
    document to call my function but when I do I get an error that says
    Attempt access of inaccessible method deleteContact through a
    reference with static type myTitleWindowContact?
    private function deleteContact(event:Event,data:*):void{
    if (contactData.selectedIndex >= 1) {
    caseVO.acCont.removeItemAt(contactData.selectedIndex);
    <mx:DataGrid dataProvider="{model.currentVO.acCont}"
    id="contactData"
    width="651"
    height="117"
    click="showForm()" >
    <mx:columns>
    <mx:DataGridColumn editable="false" width="5">
    <mx:itemRenderer>
    <mx:Component>
    <mx:HBox width="100%" height="15"
    horizontalAlign="center" verticalAlign="middle">
    <mx:Button
    icon="@Embed(source='/com/serg/reportingTool/assets/images/delete.png')"
    click="outerDocument.deleteContact(event,data)"
    label="D"
    toolTip="Delete"
    width="15"
    height="15"
    />
    </mx:HBox>
    </mx:Component>
    </mx:itemRenderer>
    </mx:DataGridColumn>

    That fixed that issue Thanks so much! One other question
    though. Is it possible to have my delete button appear on all items
    in the datagrid except for the first item??

  • Overriding Spark DataGrid item renderer's prepare method - renderer's child is initially null

    I am currently using the 4.12.0 SDK.  I have a Spark DataGrid setup that makes use of an externally-defined itemRenderer:
    <s:DataGrid id="dgEquipment"
                width="100%" height="100%"
                doubleClickEnabled="true"
                creationComplete="init()" doubleClick="popTab(event)">
      <s:columns>
        <s:ArrayList>
          <s:GridColumn itemRenderer="renderers.equipment.IconRenderer"
                        dataField="EXISTING"
                        width="22"/>
    The data provider is set programmatically after a remote call has returned a result.
    I have the renderer setup as follows:
    <?xml version="1.0" encoding="utf-8"?>
    <s:GridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
                        xmlns:s="library://ns.adobe.com/flex/spark"
                        xmlns:mx="library://ns.adobe.com/flex/mx"
                        dataChange="init()" remove="dispose()">
      <s:layout>
        <s:VerticalLayout horizontalAlign="center" verticalAlign="middle"/>
      </s:layout>
      <fx:Script>
        <![CDATA[
          import mx.controls.Menu;
          import mx.events.MenuEvent;
          import spark.components.DataGrid;
          [Bindable]
          [Embed(source="../../../assets/images/Icon 1.png")]
          private var ico1:Class;
          [Bindable]
          [Embed(source="../../../assets/images/Icon 2.png")]
          private var ico2:Class;
          [Bindable]
          [Embed(source="../../../assets/images/Icon 3.png")]
          private var ico3:Class;
          private var isExisting:Boolean;
          private var popUp:Menu;
          private function init():void
            if (data)
              isExisting = data.EXISTING == 1;
          private function dispose():void
            if (popUp)
              popUp.removeEventListener(MenuEvent.ITEM_CLICK, popUp_click);
              popUp = null;
            if (imgActions)
              imgActions.removeEventListener(MouseEvent.CLICK, image_click);
              imgActions = null;
          override public function prepare(hasBeenRecycled:Boolean):void
            if (data)
              if ((data.TYPE == "A" || data.TYPE == "B") && !data.X && !data.Y)
                disableLink();
                imgActions.source = ico3;
                imgActions.toolTip = "Blah blah.";
              else if (data.TYPE == "C" || data.TYPE == "D")
                disableLink();
              else if (isExisting)
                imgActions.source = ico1;  //******************************            imgActions.toolTip = "More blah blah.";
                imgActions.addEventListener(MouseEvent.CLICK, image_click);
              else
                imgActions.source = ico2;
                imgActions.addEventListener(MouseEvent.CLICK, image_click);
                imgActions.toolTip = "Even more blah blah.";
                initPopUp();
          private function initPopUp():void
          private function popUp_click(event:MenuEvent):void
          private function image_click(event:MouseEvent):void
          private function disableLink():void
        ]]>
      </fx:Script>
      <s:Image id="imgActions"
               height="18" width="18"/>
    </s:GridItemRenderer>
    When the code reaches the line where I have added a comment full of asterisks, I get the following error:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at renderers.equipment::IconRenderer/prepare()[C:\…\renderers\equipment\IconRenderer.mxml:81 ]
        at spark.components.gridClasses::GridViewLayout/initializeItemRenderer()[/Users/justinmclean /Documents/ApacheFlex4.12.0/frameworks/projects/spark/src/spark/components/gridClasses/Gri dViewLayout.as:1808]
        at spark.components.gridClasses::GridViewLayout/createTypicalItemRenderer()[/Users/justinmcl ean/Documents/ApacheFlex4.12.0/frameworks/projects/spark/src/spark/components/gridClasses/ GridViewLayout.as:1243]
        at spark.components.gridClasses::GridViewLayout/updateTypicalCellSizes()[/Users/justinmclean /Documents/ApacheFlex4.12.0/frameworks/projects/spark/src/spark/components/gridClasses/Gri dViewLayout.as:1374]
        at spark.components.gridClasses::GridViewLayout/measure()[/Users/justinmclean/Documents/Apac heFlex4.12.0/frameworks/projects/spark/src/spark/components/gridClasses/GridViewLayout.as: 875]
        at spark.components.supportClasses::GroupBase/measure()[/Users/justinmclean/Documents/Apache Flex4.12.0/frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as:1156 ]
        at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::measureSizes()[/Users/justinmclean/Documents/ApacheFlex4.12.0/frameworks/projects/framework/src/mx/cor e/UIComponent.as:9038]
        at mx.core::UIComponent/validateSize()[/Users/justinmclean/Documents/ApacheFlex4.12.0/framew orks/projects/framework/src/mx/core/UIComponent.as:8962]
        at spark.components::Group/validateSize()[/Users/justinmclean/Documents/ApacheFlex4.12.0/fra meworks/projects/spark/src/spark/components/Group.as:1074]
        at mx.managers::LayoutManager/validateSize()[/Users/justinmclean/Documents/ApacheFlex4.12.0/ frameworks/projects/framework/src/mx/managers/LayoutManager.as:673]
        at mx.managers::LayoutManager/doPhasedInstantiation()[/Users/justinmclean/Documents/ApacheFl ex4.12.0/frameworks/projects/framework/src/mx/managers/LayoutManager.as:824]
        at mx.managers::LayoutManager/doPhasedInstantiationCallback()[/Users/justinmclean/Documents/ ApacheFlex4.12.0/frameworks/projects/framework/src/mx/managers/LayoutManager.as:1188]
    Running the debugger shows that this occurs with the first item in the data provider.  If I alter the prepare method to check for the existence of imgActions before doing anything, everything works fine after the first item.  So I'll have one row in the DataGrid with a missing icon, and all the rest will have icons.
    So the question is, is it normal for prepare to run before any children of the item renderer are created?  If so, how should I handle this?
    Many thanks in advance.

    A little more info.  I added some event handlers to the renderer and the image (for events that I thought would be relevant), and here is the order of events based on trace statements within the handlers:
    griditemrenderer1_addedHandler
    griditemrenderer1_addedToStageHandler
    griditemrenderer1_preinitializeHandler
    imgActions_addedHandler
    griditemrenderer1_addedHandler
    imgActions_addedToStageHandler
    imgActions_preinitializeHandler
    imgActions_addedHandler
    griditemrenderer1_addedHandler
    imgActions_initializeHandler
    griditemrenderer1_elementAddHandler
    imgActions_addHandler
    griditemrenderer1_initializeHandler
    griditemrenderer1_addHandler
    prepare called
    imgActions_resizeHandler
    griditemrenderer1_resizeHandler
    imgActions_creationCompleteHandler
    imgActions_updateCompleteHandler
    griditemrenderer1_creationCompleteHandler
    griditemrenderer1_updateCompleteHandler
    griditemrenderer1_removeHandler
    griditemrenderer1_addedHandler
    griditemrenderer1_addedToStageHandler
    imgActions_addedToStageHandler
    griditemrenderer1_addHandler
    griditemrenderer1_dataChangeHandlerTypeError: Error #1009: Cannot access a property or method of a null object reference.
    prepare called
        at renderers.equipment::IconRenderer/prepare()[C:\…\renderers\equipment\IconRenderer.mxml:91 ]
    imgActions_renderHandler
    griditemrenderer1_renderHandler

  • Item Renderer Changes

    Hey guys,
    I wanted to let you know that we've made some changes to the ItemRenderer class in Spark.  The changes and reasons for the change are outlined here: http://opensource.adobe.com/wiki/display/flexsdk/Item+Renderer+Changes .  Also note that this may break existing ItemRenderers.
    An overview of the change is given below:
    In MX, the selection/rollover highlight was automatically drawn by the List. In Spark, item renderers control everything about their appearance. In a Spark ItemRenderer, you can use states to figure out what to display in the selection/rollover state.  This is still true before and after the most recent changes; however, we're providing a new flag, autoDrawBackground, which will automatically draw the selection/rollover highlight for you.  By default this flag is on so you don't need to worry about the selection/rollover highlight.  If you want more control over what happens in the selection/rollover states and don't want the default highlight rectangle, you can turn this flag off by setting autoDrawBackground=false on your ItemRenderer class.  Turning this flag off would give you the same behavior you have today.
    If you have any questions, please let us know.
    Thanks,
    Ryan

    "Brij_Mohan" <[email protected]> wrote in
    message
    news:g79fs8$ccv$[email protected]..
    > Attached is the code that fills the combos and add new
    info the the
    > arraycolecction. It is the code for combobox
    itemrenderer which is used in
    > the
    > datagrid.
    >
    >
    > <?xml version="1.0" encoding="utf-8"?>
    > <mx:HBox xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="100%"
    > dataChange="setSelectedItem(event)"
    > horizontalAlign="center"
    > horizontalScrollPolicy="off"
    > /* verticalScrollPolicy="off"
    creationComplete="fillList();" */
    this is the only time you call fillList, and it appears to be
    commented out.
    In your override of the listData setter, you need to set a
    flag that you
    check for in an override of commitProperties. In
    commitProperties, if the
    flag is true, then run the function.
    HTH;
    Amy

  • Item renderer - rowIndex

    If I delete a row in an ArrayCollection which is my dataProvider how can I make sure that item renderer's rowIndex property will be showing a value based on new number (positions) or rows in the grid?
    Thanks

    I will work on a case for that and other questions as soon as porpbably tomorrow.
    Thank you

  • ColumnChart - 3D Item Renderer problem

    I'm building a 3D column chart and am finding that I need to
    draw the columns in a specific order other than the default, which
    appears to be by series.
    Things go just fine until the z-order depth is greater than
    the distance between the series. Once that occurs, the potential
    exists for things to go south.
    To demonstrate the issue, I've put a few screenshots here:
    3D Column Chart
    Images
    My question: Is there a way to define, or otherwise take over
    the drawing order of the ColumnSeriesItems? I want to draw the
    columns in the order they appear from left to right, but Flex seems
    to want to draw by order of series - first Series1, then Series2,
    then Series3, etc.
    I'm looking through the Framework source code, but I haven't
    found a way around this - yet. Of course, if there's another
    approach, like using some clipping method I'm not aware of, etc,
    please feel free to clue me in.
    Thanks in advance to anyone with useful info.

    Thanx for reply.But this is not what i am looking for.I need
    to apply different colors for each bars.I am generating charts
    dynamically.The item renderer is working fine.But at specific
    condition the item renderer shold ne removed from the chart series

  • Programmatically selecting hovered state of item renderer - Greg pleeease

    I'm a bit new to Flex, so I have the idea but can't get it to work.
    I'm using an item renderer that takes its data from an HTTPService
        <s:SkinnableDataContainer
                                  dataProvider="{boData}"
                                  itemRenderer="extras.BoItemRenderer"
                                  skinClass="extras.BoSkin" />
    the boData data provider is an ArrayCollection not an Array
    In my <s:ItemRenderer ...... > (BoItemRenderer.mxml)  I have
    - 2 states: normal and hovered (each has different style, which I will leave out to keep things simple)
    - and the data is presented as follows:
        <s:HGroup>
            <s:Label text="{data.idNum}" />         
            <s:Label text="{data.firstName}" />
            <s:Label text="{data.lastName}" />
        </s:HGroup>
    Naturally as I hover on any row in the item renderer, it changes to the hovered state styling, all done by flex.
    What I want to do however is programmatically induce that hover state without actually hovering.
    For example, given a hard-coded idNum, I need to programmatically set the state of that row to hovered.
    My approach is as follows, but not sure how to target that specific item,
    - search the dataProvider to find the index of the row with idNum that matches my hard-coded value. I looked at the documentation, and there is indexOf, but it's for Array and not ArrayCollection.. also not sure how that works since I'd like to read the data from the item renderer directly, not from the original data provider.
    - then I would find that index in the itemrenderer and set the state of that index to hovered.
    Simpler said then done, but I'm stuck on it...
    Thanks,
    David

    Depending on what is it the ArrayCollection, in theory you might be able to do this:
    var myIndex:uint;
    for(var a:uint=0;a<myCollection.length;a++){
        if(myCollection.getItemAt(a).idNum == myHardCodedIdNum){
            myIndex = a;
            break;
    You can programmatically simulate a hover over by having the component manually dispatch a mouseOver event, but this is not the way to do it with itemRenderers.
    Item renderers can be tricky, particularly if they are being used in List based controls, like List, DataGrid, TileList, etc. because the itemRenderers are recycled.
    With that in mind, and with your somewhat non-typical situation (manually simulating hover over), I might be wrong on this, but it might be best to control this via the dataProvider data. So have a field named currState, and somehow make the renderer automatically change its state if that data field changes, then you simply programmatically change the currState data field for the desired item.
    As far as how to change the state of the item renderer based on changes to a data field, maybe ChangeWatcher?
    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

  • Any Help ? My Item Renderer fails with Reference Error: Error #1069:

    So I have a basic inline dropdownbox itemrenderer as shown below, But after I click it and select a value I get an error "ReferenceError: Error #1069: Property TELEPH_USE_TYPE_DESC not found".  I am guessing I am referencing something incorrectly. Any Ideas
    Code
    <mx:AdvancedDataGridColumn dataField="TELEPH_USE_TYPE_DESC" editorDataField="TELEPH_USE_TYPE_DESC">
        <mx:itemEditor>
            <fx:Component>            <s:MXAdvancedDataGridItemRenderer focusEnabled="true" height="22">
                    <s:DropDownList                     id="dd"
                        top="5"
                        left="5"
                        labelField="TELEPH_USE_TYPE_DESC"                   selectedItem="{data.TELEPH_USE_TYPE_DESC}"                   dataProvider="{parentDocument.tpUseAc}" />            </s:MXAdvancedDataGridItemRenderer>          </fx:Component>
        </mx:itemEditor></mx:AdvancedDataGridColumn> 

    TELEPH_USE_TYPE_DESC is a field on the data object, but not a property on the item renderer which is defined within the mx:itemEditor tag.
    You could add something like
    <mx:Script>
    <![CDATA[
        public function get newValue():Object
             return dd.selectedItem.TELEPH_USE_TYPE_DESC;
    \]\]\>
    </mx:Script>
    And change the editorDataField to “newValue”

  • Problem with checkbox item renderer in datagrid

    I have a data grid having check box as an item renderer. I have viewed many posts in this forum but nothing useful in my case. I am failed to bind my datagrid itemrenderer checkbox with the field of dataprovider i.e. listUnitMovement.CHECK_PATH. Then I have to traverse data provider to check which checkboxes are checked.
    [Bindable]
    var listUnitMovement:XMLList=null;                      
    In a function call
    public function init(event:ResultEvent):void
        listUnitMovement=event.result.unitmovement;
         <mx:DataGrid id="dg_country"
                               dataProvider="{listUnitMovement}"
                                  enabled="true">
                                <mx:columns>
                                   <mx:DataGridColumn>
                                        <mx:itemRenderer>
                                            <mx:Component>
                                                <mx:CheckBox selectedField="CHECK_PATH"  />
                                            </mx:Component>                                       
                                        </mx:itemRenderer>
                                    </mx:DataGridColumn>
                                    <mx:DataGridColumn headerText="Latitude" dataField="NEW_LAT" visible="false"/>
                                    <mx:DataGridColumn headerText="Longitude" dataField="NEW_LONG" visible="false"/>
                                   <mx:DataGridColumn>
                                        <mx:itemRenderer>
                                            <mx:Component>
                                                <mx:Button label="Details"/>
                                            </mx:Component>                                       
                                        </mx:itemRenderer>
                                    </mx:DataGridColumn>
                                </mx:columns>
                            </mx:DataGrid>

    Hi,
    Do you want to just check/uncheck the checkboxes based on the CHECK_PATH field.
    Do you want something like this...
    <?xml version="1.0" encoding="utf-8"?><mx:Application  xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
     <mx:Script>
    <![CDATA[
     import mx.collections.ArrayCollection;[
    Bindable] 
    private var listUnitMovement:ArrayCollection = new ArrayCollection([{CHECK_PATH:true,NEW_LAT:109.233,NEW_LONG:232.22},{CHECK_PATH:true,NEW_LAT:109.233,NEW_LONG:232.22},{CHECK_PATH:false,NEW_LAT:133.233,NEW_LONG:702.22}]);]]>
    </mx:Script>
     <mx:DataGrid dataProvider="{listUnitMovement}">
     <mx:columns>
     <mx:DataGridColumn>
     <mx:itemRenderer>
     <mx:Component>
     <mx:CheckBox selectedField="CHECK_PATH" change="data.CHECK_PATH=selected" />
     </mx:Component>  
    </mx:itemRenderer>
     </mx:DataGridColumn>
     <mx:DataGridColumn dataField="NEW_LAT"/>
     <mx:DataGridColumn dataField="NEW_LONG"/>
     </mx:columns>
     </mx:DataGrid>
    </mx:Application>
    Please let me know clearly what's your problem...Do you want to just bind the check box based on XmlList or something else..?
    Thanks,
    Bhasker Chari.S

  • Using a bitmap object as a item renderer in a datagrid

    I have a UIComponent grabbed has a bitmap, and stored in an
    array collection.
    I want to display a thumbnail in a datagrid, I can make a
    itemRenderer for an image with a local or remote file as a source.
    But how do I use the bitmap in the array collection in an item
    renderer.
    Thanks
    Dean

    Here is an example with a HorizontalList:
    <?xml version="1.0" ?>
    <!-- itemRenderers\htlist\myComponents\Thumbnail.mxml
    -->
    <mx:VBox xmlns:mx="
    http://www.adobe.com/2006/mxml"
    horizontalAlign="center"
    verticalGap="0" borderStyle="none" backgroundColor="white"
    >
    <mx:Image id="image" width="60" height="60"
    source="{data.image}"/>
    <mx:Label text="{data.name}" width="120"
    textAlign="center"/>
    <mx:Label text="${data.price}" fontWeight="bold"/>
    </mx:VBox>
    <?xml version="1.0"?>
    <!-- itemRenderers\htlistMainlistThumbnailRenderer.mxml
    -->
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml">
    <mx:Model id="catalog" source="catalog.xml"/>
    <mx:HorizontalList id="myList"
    columnWidth="125"
    rowHeight="125"
    columnCount="4"
    dataProvider="{catalog.product}"
    itemRenderer="myComponents.Thumbnail"/>
    <mx:LinkButton label="Product images courtesy of Lavish"
    click="navigateToURL(new URLRequest('
    http://www.shoplavish.com'),
    '_blank')"/>
    </mx:Application>
    <?xml version="1.0"?>
    <catalog>
    <product id="1">
    <name>USB Watch</name>
    <price>129.99</price>
    <image>assets/products/usbwatch.jpg</image>
    <thumbnail>assets/products/usbwatch_sm.jpg</thumbnail>
    </product>
    <product id="2">
    <name>007 Digital Camera</name>
    <price>99.99</price>
    <image>assets/products/007camera.jpg</image>
    <thumbnail>assets/products/007camera_sm.jpg</thumbnail>
    </product>
    <product id="3">
    <name>2-Way Radio Watch</name>
    <price>49.99</price>
    <image>assets/products/radiowatch.jpg</image>
    <thumbnail>assets/products/radiowatch_sm.jpg</thumbnail>
    </product>
    <product id="4">
    <name>USB Desk Fan</name>
    <price>19.99</price>
    <image>assets/products/usbfan.jpg</image>
    <thumbnail>assets/products/usbfan_sm.jpg</thumbnail>
    </product>
    <product id="5">
    <name>Caffeinated Soap</name>
    <price>19.99</price>
    <image>assets/products/soap.jpg</image>
    <thumbnail>assets/products/soap_sm.jpg</thumbnail>
    </product>
    <product id="6">
    <name>Desktop Rovers</name>
    <price>49.99</price>
    <image>assets/products/rover.jpg</image>
    <thumbnail>assets/products/rover_sm.jpg</thumbnail>
    </product>
    </catalog>

Maybe you are looking for

  • Problem in sender file adapter

    Hi all,   I have a sender file adapter using ftp with processing mode delete. But my input file is not getting deleted. In RWB, the adapter satus is green with msg processed sucessfully. I tried with a file name that is not available in the ftp folde

  • Issue with LPCOR on CME 10.5

    Dear All, I am facing issues with LPCOR configuration on CME 10.5. For International calls the Authentication Prompts triggers some times and some times doen not. Also when a local call is dialed the Authentication Prompt is triggered some times.Belo

  • 10.5.8.boot drive does no longer boots onto 10.3.9 PPC mini

    I boot my workplace Mac Mini from an external drive. I have been booting 10.5.1 successfully for a long time. Now I have updated to 10.5.8 and the drive usually does not boot (it did once in many attempts). After the Apple logo appears, but before th

  • Best practice for OSB to OSB communication

    Cross posting this message: I am currently in a project where we have two OSB that have to communicate. The OSBs are located in different security zones ("internal" and "secure"). All communication on a network level must be initiated from the secure

  • Okay. I don't know if it's the broadband that I'm using or is it firefox, but I'm having trouble with a certain website namely Tumblr.

    Okay. I don't know if it's the broadband that I'm using or is it firefox, but I'm having trouble with a certain website namely Tumblr. I can login just fine, but everytime it tries to redirect me to its dashboard, it'll direct me to another site inst