Item Renderer complains about binding

I have a data grid bound to an xml list. In the datagrid, I
am using an item renderer:
<mx:Canvas xmlns:mx="
http://www.adobe.com/2006/mxml"
width="270" height="80" verticalScrollPolicy="off"
horizontalScrollPolicy="off">
<mx:VBox width="100%" height="100%" verticalGap="0"
paddingLeft="5" paddingTop="4" paddingRight="5"
paddingBottom="5">
<mx:Label id="title" text="{data.title}" width="100%"
styleName="videoTitle"/>
<mx:Text id="caption" text="{data.description}"
width="100%" styleName="videoCaption"/>
</mx:VBox>
</mx:Canvas>
It works fine, but if I debug it I get:
warning: unable to bind to property 'title' on class 'XML'
(class is not an IEventDispatcher)
warning: unable to bind to property 'description' on class
'XML' (class is not an IEventDispatcher)
For each of my tiles. How do I make this go away?

This is because "data" is really an "Object" containing the
XML. While XML IS bindable (the warning is confusing) Object is
not.
The solution is to cast or convert the object ot XML:
text="{XML(data).title}"
Tracy

Similar Messages

  • Item Renderer Display Optimization

    I have pretty basic row item renderer displayed within a data group, it is composed of a few labels and an icon. It has a few nested layouts to display everything properly, but I would not consider it a complicated layout by any means.
    Whenever I display a result set, 20 rows of data, it appears Flex is choking displaying the item renders. It takes about half a second from the moment all the item renders have been created to actually draw them on the screen and the Flex code that handles the drawing appears to be blocking because everything on the screen freezes during this half second period. This display blocking turns a very fluid display rich application into a choppy mess whenever results are displayed.
    I have gone great lengths to make sure none of my code is blocking and that I always give Flash Player the room it needs to breath to maintain it's frame rate, however I am stuck with this display issue. Any suggestions would be appreciated.

    Thanks for the reply Sasha. I will try an AS item renderer but I have to say that data binding and layout management are probably the two biggest reasons to use Flex in the first place. If I can't use those items and have a smooth interface I might as well go back to just writing everything using Flash. (this is a little bit irritating to say the least)
    Below is the code to one of the item renderers that is casuing probelms...if anything sticks out as wrong or out of place please let me know.
    I appreciate your time, and response. Thank you.
    <?xml version="1.0" encoding="utf-8"?>
    <s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
                    xmlns:s="library://ns.adobe.com/flex/spark"
                    xmlns:mx="library://ns.adobe.com/flex/mx"
                    autoDrawBackground="false"
                    width="100%" height="76"
                    mouseChildren="true"
                    click="clickHandler(event)"
                    buttonMode="true"
                    useHandCursor="true" >
        <fx:Script>
            <![CDATA[
                   //removed
            ]]>
        </fx:Script>
        <s:states>
            <s:State name="hovered" />
            <s:State name="normal"/>
        </s:states>
        <s:transitions>
            <s:Transition fromState="normal" toState="hovered">
                <s:Parallel>
                    <s:Fade target="{backgroundRollover}" alphaFrom="0" alphaTo="1" duration="0"/>
                </s:Parallel>
            </s:Transition>
            <s:Transition fromState="hovered" toState="normal">
                <s:Parallel>
                    <s:Fade target="{backgroundRollover}" alphaFrom="1" alphaTo="0" duration="0"/>
                </s:Parallel>
            </s:Transition>
        </s:transitions>
        <!-- background fill -->
        <s:Rect id="background" width="100%" height="100%" alpha="0">
            <s:fill>
                 <s:SolidColor color="#FFFFFF"/>
             </s:fill>
        </s:Rect>
        <!-- background rollover fill -->
        <s:BorderContainer id="backgroundRollover" width="100%" height="76" styleName="borderContainerLight" cornerRadius="0" alpha="0" borderAlpha="0"/>
        <!-- border bottom-->   
        <controls:HDivLine bottom="0"/>
        <!-- content -->
        <s:HGroup id="row" width="100%" height="100%" gap="12" paddingLeft="12" paddingRight="12" verticalAlign="middle" horizontalAlign="center">
            <!-- place -->
            <s:Group>
                <s:layout>
                    <s:VerticalLayout horizontalAlign="center"/>
                </s:layout>
                <s:Label id="position" text="{data.index}" styleName="small light" width="20" textAlign="center"/>
            </s:Group>
            <!-- box art -->
            <s:Group id="boxArtGroup" >       
                <controls:ImageLoader id="boxart" source="{data.boxArtPath}" width="64" height="64" click="btnQuickView_clickHandler(event)"/>
            </s:Group>
            <!-- title and esrb rating -->       
            <s:Group width="60%" minWidth="160">
                <s:layout><s:VerticalLayout horizontalAlign="left"/></s:layout>
                <s:Label id="title" text="{data.title}" styleName="large bold" width="100%"/>
                <s:Label text="ESRB: {data.esrbRating}" styleName="small light"/>
            </s:Group>
            <!-- platform icon -->
            <s:Group width="10%" minWidth="82">
                <s:layout>
                    <s:HorizontalLayout horizontalAlign="center" />
                </s:layout>
                <s:BitmapImage source="{PlatformIcons.getIcon(data.platform)}"/>
            </s:Group>
            <!-- release date -->
            <s:Group width="20%" minWidth="74">
                <s:layout><s:VerticalLayout horizontalAlign="center"/></s:layout>
                <s:Label text="{data.releaseDate}" styleName="bold"/>
                <s:Label text="release date" styleName="small light"/>
            </s:Group>
            <!-- rating average -->
            <s:Group width="10%" minWidth="74">
                <s:layout><s:VerticalLayout horizontalAlign="center" verticalAlign="middle"/></s:layout>
                <controls:RatingBoxSmall width="48" height="48" ratingType="RATING" ratingNumber="{data.memberRating}"/>
            </s:Group>
        </s:HGroup>
    </s:ItemRenderer>

  • 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

  • Data provider problem in custom item renderer

    I have a complex, custom item renderer for a list. I add
    items that I extracted from an xml to the data provider using the
    IList interface. But when displaying the list, the items are all
    screwed up. Each rendered item has some parts which are initialized
    as different components depending on the values from the xml. This
    initialization is called in the item renderer for the
    creationComplete event.
    The weird thing is that when I output the dataProvider to
    check its values, some of the items have internal uids sometimes
    and sometimes they don't. If I output the dataProvider right after
    I add the items to it, none of them get internal uids. But from the
    initialize method, some of them do and some don't.
    To make things weirder, sometimes, as I scroll up and down
    the list, the dynamic components get all switched up. I'm either
    having a problem with internal uids or with the creation policies
    for lists. Or it's probably some simpler mistake I have yet to see.
    Anyone have any idea where the problem could lie? Any help is
    greatly appreciated.

    Any successful render must:
    1) override the set data property of the component
    Further, best practice is to store any data you need in the
    override set data(), and call invalidateProperties(). Then do the
    actual work in an override commitProperties() function.
    The framework is smart about when to call commitProperties
    efficiently. set data() gets called much more often.
    Tracy

  • Image in item renderer issue for List Components

    Hello,
    I have an issue when I use an item renderer with an image in
    it. This happens when I do this with a List or TileList component
    that has enough items to create a scroll bar. What happens is the
    images load fine, then I scroll down and the other items and their
    images start appearing, but then the first and last images start
    loading the wrong image. I'll scroll back up and the first item now
    has a different image, and when I scroll back down, the last images
    changes too.
    Has anyone had this problem with image itemrenderers in List
    components?
    Thanks for any help.
    Brade

    The creationComplete event is called ONCE and that's it. But
    each time an itemRenderer is recycled it will have its data
    property reset with new a new record from the dataProvider. Thus
    overriding the set data function lets you inspect the data and do
    what you want with it.
    Data binding in MXML <mx:Image source="{data.image}" />
    is set up by the Flex compiler. When the data property is reset it
    will trigger the data binding notifications. The Flex
    compiler-generated code will intercept that and update the Image
    source property.
    If you use MXML, then use data binding. If you write your
    itemRenderer in ActionScript, override the set data
    function.

  • Checkbox item renderer populated with data from 2 sources

    I have a list object that has a check box and a label (using an inline item renderer).  The list itself is populated with an array of objects and whether the checkbox is selected takes those objects and adds them to another list (for outbound purposes).  Since the selected list can change elsewhere in my app how do I keep the binding of selections consistent?  The dataprovider for my checkbox list is the first array of objects and is binded, but the second one (selected array) is not.  What would be the best way to provide that binding to make sure the selected is consistent when the second array changes.  Some of the code is below to better show...
    <cms:HilightList
         id = "distributorList"
         width = "100%"
         height = "100%"
         drawHighlight="{ViewUtils.drawHighlightIndicator}"
         drawSelection="{ViewUtils.drawHighlightIndicator}"
         dataProvider="{pmDistributors.distributors}">
         <mx:itemRenderer>
              <mx:Component>
                   <mx:HBox>
                        <mx:CheckBox
                                           selected = "{outerDocument.isSelected(data)}"
                               change = "{outerDocument.handleSelectedChange(event)}"/>
                        <mx:Label text="{data.name}"/>
                   </mx:HBox>
              </mx:Component>
         </mx:itemRenderer>
    </cms:HilightList>
    public function isSelected(item:Object):Boolean
         var partner:Partner = item as Partner;
         var selected:Boolean = false;
         for each(var schedPartner:Partner in scheduleAssets.partners)
              if(schedPartner.id == partner.id)
                   selected = true;
         return selected;
    public function handleSelectedChange(event:Event):void
         var partner:Partner = event.currentTarget.parent.data as Partner;
              if(event.currentTarget.selected)
                   addPartnerEvent(partner);
              } else {
                   removePartnerEvent(partner);

    Hi Aakcse,
    In this condition, you need to make use of both the Precedence Constraint between Control Flow Tasks and the Conditional Split Transformation. Supposing you get the value in the flat file and store it in a variable via Script Task, you can create two Data
    Flow Tasks, and connect the Script Task to the two DFTs.
    For the Precedence Constraint between the Script Task and the Data Flow Task 1, set the “Expression and Constraint” expression to @[User::vEntryStatus]=="Y". And for the Precedence Constraint between the Script Task and the Data Flow Task 2, set the “Expression
    and Constraint” expression to @[User::vEntryStatus]=="N".
    In Data Flow Task 1, add a Conditional Split Transformation with this expression [Entry]==”YES”, and direct this output to the destination component. In Data Flow Task 2, also add a Conditional Split Transformation with expression [Entry]==”NO”, and direct
    the output to the destination component.
    Regards,
    Mike Yin
    If you have any feedback on our support, please click here
    Mike Yin
    TechNet Community Support

  • Item Renderer in Advanced Data Grid

    I have checkbox against each folder in the datagrid and
    binded to XMLListCollection. When the value in the field is true, i
    want that checkbox to be selected. Its not working. Here is the
    code. I want to know how item render is working in AdvancedDataGrid
    Thanks in advance.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="vertical">
    <mx:Script>
    <![CDATA[
    import mx.collections.HierarchicalData;
    import mx.collections.XMLListCollection;
    ]]>
    </mx:Script>
    <mx:XMLList id="dpHierarchyXML" >
    <Clegs>
    <Cleg name="Cleg1" sel="true">
    <FlightLeg createdDate="10/10/2008"
    effectiveDate="10/10/2008"
    endDate="10/10/2008" modifiedDate="10/12/2008"
    station="ATL" carrier="Delta"
    flightNo="9W756" acType="122"
    beginDate="10/10/2008" timeRange="10"
    doop="123" region="XYZ"
    year_duration="0.24" moons="0"
    cost="1250"
    />
    </Cleg>
    <Cleg name="Cleg2" sel="true">
    <FlightLeg createdDate="10/10/2008"
    effectiveDate="10/10/2008"
    endDate="10/10/2008" modifiedDate="10/12/2008"
    station="ATL" carrier="Delta"
    flightNo="9W756" acType="122"
    beginDate="10/10/2008" timeRange="10"
    doop="123" region="XYZ"
    year_duration="0.24" moons="0"
    cost="1250"
    />
    </Cleg>
    </Clegs>
    </mx:XMLList>
    <mx:AdvancedDataGrid
    id="adg"
    dataProvider="{new HierarchicalData(dpHierarchyXML.Cleg)}"
    rowCount="20"
    width="100%"
    treeColumn="{leg}"
    variableRowHeight="true"
    wordWrap="true" dropEnabled="true" dragEnabled="true"
    dragMoveEnabled="true" sortExpertMode="true"
    >
    <mx:columns>
    <mx:AdvancedDataGridColumn dataField="@sel"
    headerText=" " width="25" rendererIsEditor="true"
    editable="true" editorDataField="selected" />
    <mx:AdvancedDataGridColumn dataField="@name" id="leg"
    headerText="cLeg" />
    <mx:AdvancedDataGridColumn dataField="@createdDate"
    headerText="Created Date" />
    <mx:AdvancedDataGridColumn dataField="@effectiveDate"
    headerText="Effective Date" />
    <mx:AdvancedDataGridColumn dataField="@endDate"
    headerText="End Date" />
    <mx:AdvancedDataGridColumn dataField="@modifiedDate"
    headerText="Modified Date" />
    <mx:AdvancedDataGridColumn dataField="@station"
    headerText="Station" />
    <mx:AdvancedDataGridColumn dataField="@carrier"
    headerText="Carrier" />
    <mx:AdvancedDataGridColumn dataField="@flightNo"
    headerText="Flight No" />
    <mx:AdvancedDataGridColumn dataField="@acType"
    headerText="Account Type" />
    <mx:AdvancedDataGridColumn dataField="@beginDate"
    headerText="Begin Date" />
    <mx:AdvancedDataGridColumn dataField="@timeRange"
    headerText="Time Range" />
    <mx:AdvancedDataGridColumn dataField="@doop"
    headerText="DOOP" />
    <mx:AdvancedDataGridColumn dataField="@region"
    headerText="Region" />
    </mx:columns>
    <mx:rendererProviders>
    <mx:AdvancedDataGridRendererProvider columnIndex="0"
    columnSpan="1" depth="1" renderer="mx.controls.CheckBox">
    </mx:AdvancedDataGridRendererProvider>
    </mx:rendererProviders>
    </mx:AdvancedDataGrid>
    </mx:Application>

    2) You do not set an item editor only an item renderer.
    <mx:AdvancedDataGridRendererProvider columnIndex="0"
    columnSpan="1" depth="1" renderer="mx.controls.CheckBox">
    3) You do not have rendererIsEditor on any columns that I can
    see.
    <mx:AdvancedDataGridColumn dataField="@sel"
    headerText=" " width="25" rendererIsEditor="true"
    editable="true" editorDataField="selected"/>
    If I use the itemrender for that column, i am gettting the
    check box for all the rows. Which i dont want . I want check box
    only for the folder node. so i am using renderer provider
    I want only one column to be editable

  • Item Renderer in a Datagrid

    I'm struggling with how to make a check mark ( image ) show
    up or not based on the value of some data in each datagrid line
    item. I'm using an item renderer but I'm missing something. Any
    help would be greatly appreciated.
    thanks,
    STeveR

    The following is my entire itemrenderer...please excuse any
    bad style as this is a WIProgress..
    Its probably easier to quote the adobe docs on listdata...If
    a component implements the IDropInListItemRenderer interface, you
    can use its listData property to obtain information about the data
    passed to the component when you use the component in an item
    renderer or item editor..I made sure the component implements the
    interface as you can see in the code at the top of component. Then
    add the couple of required functions regarding listdata, then you
    can access the listdata in your own functions in the renderer, like
    i do in set data function.
    this.BTN_***_mark.label =
    value[DataGridListData(listData).dataField];
    this line assigns the value from my datagrid to the renderers
    button label. (this renderer is a button that the user can press)
    so i want the buttons label to show the value coming in from the
    datagrid. So listdata is just a way to
    explicitly get the column name where the current data is
    being sourced from in your datagrid.As the grid is being rendered,
    it renders row by row. In each row it goes thru your columns . SO
    initially it for row 1 it would begin rendering firstname, surname,
    mark, average...etc etc. If i put an alert in on
    value[DataGridListData(listData).dataField
    I would see these column names popping up as they are getting
    rendered in the DGrid.
    Hope this helps...
    <!-- <?xml version="1.0" encoding="utf-8"?>-->
    <mx:VBox xmlns:mx="
    http://www.adobe.com/2006/mxml"
    creationComplete="init()" width="74" height="30"
    horizontalAlign="center" verticalAlign="middle"
    implements="mx.core.IFactory,mx.controls.listClasses.IDropInListItemRenderer">
    <mx:Metadata>
    </mx:Metadata>
    <mx:Script>
    <![CDATA[
    import mx.managers.PopUpManager;
    import mx.controls.DataGrid;
    import mx.utils.ArrayUtil;
    import mx.collections.ArrayCollection;
    import mx.collections.IViewCursor;
    import mx.controls.Alert;
    import mx.events.*;
    import mx.controls.dataGridClasses.DataGridListData;
    import mx.controls.listClasses.BaseListData;
    import mx.controls.dataGridClasses.DataGridColumn;
    import mx.containers.TitleWindow;
    private var panel:AssessmentMarkPopup = new
    AssessmentMarkPopup();
    var the_val = 0;
    var col_index:int;
    private var _listData:BaseListData;
    public function get listData() : BaseListData
    return _listData;
    public function set listData( value:BaseListData ) : void
    _listData = value;
    private function showLoginForm():void {
    var pop:AssessmentMarkPopup =
    AssessmentMarkPopup(PopUpManager.createPopUp(this,AssessmentMarkPopup,true));
    pop.addEventListener("closepopup",onClose);
    pop.TXT_***_mark.text = this.BTN_***_mark.label;
    var row:int =
    this.parentApplication.DG_class_students.selectedIndex;
    pop.student_name =
    this.parentApplication.DG_class_students.selectedItem.firstname + "
    " + this.parentApplication.DG_class_students.selectedItem.lastname;
    private function onClose(e:MyClosePopupEvent):void{
    this.BTN_***_mark.label = e.data.mark;
    public function newInstance():*
    return new MarkEntry();
    public override function get data():Object
    return super.data;
    override public function set data(value:Object):void {
    var dg:DataGrid = (listData) ? DataGrid(listData.owner) :
    null;
    var column:DataGridColumn = (dg) ?
    dg.columns[listData.columnIndex] as DataGridColumn : null;
    col_index = listData.columnIndex;
    var str:String = String(column.dataField);
    this.BTN_***_mark.label =
    value[DataGridListData(listData).dataField];
    ]]>
    </mx:Script>
    <mx:Button click="showLoginForm()" id="BTN_***_mark"
    width="52"/>
    </mx:VBox>

  • Datagrid item renderer destroys on mouse over

    Hi,
         I used Flex 3.5 datagrid. I used item renderes in my datagrid. and i set 'rendererIsEditor = true'.
         Everything is very smooth and good. But somtimes my datagrid acting badly. When i put cursor on itemRenderer, It open-up for
    editing. When i move mouse, item renderer destroyed.
         Once it happens it is the default behaviour of my datagrid. No editing can be performed.
          But i can not reproduce it always. sometimes it a happens.
          please help me. anybody know about this?

    Simplify your test case.  Try using a simple TextInput as the renderer and
    see if you have the same problem.

  • DataGrid Item Renderer loading duplicates after scroll

    HI,
    I have a report that loads into a datagrid, these reports are
    about thumbnail images that are on a server.
    I have a datagrid item renderer that loads the thumb nails.
    When the grid first loads the first set of rows that are visible
    display the correct images. But after I scroll the new rows have
    images that are repeated and not the correct ones.
    ?xml version="1.0" encoding="utf-8"?>
    <HBox xmlns="
    http://www.adobe.com/2006/mxml"
    horizontalScrollPolicy="off" verticalScrollPolicy="off"
    creationComplete="{init()}">
    <Script>
    <![CDATA[
    import mx.controls.Image;
    [Bindable]
    [Embed(source="/images/folderBlack.png")]
    private var folderIcon:Class;
    private function suffix(url:String):String {
    var i:Number;
    if ((i = url.lastIndexOf(".")) > -1) {
    url = url.substr(i+1);
    return url;
    private function init():void {
    var fileSuffix:String = new String;
    fileSuffix = '';
    fileSuffix = suffix(data.filename);
    var staticPortalImage:String = new String;
    staticPortalImage = '/PULLIMAGE.php?type=small&id=' +
    data.FileID +
    '&path=' + data.filename +
    '&server=MTI3LjAuMC4x&siteurl=L0F1dGhNb2R1bGU=';
    var thumbNailImage:Image = new Image();
    thumbNailImage.height = 80;
    switch(fileSuffix){
    case 'jpg':
    thumbNailImage.source = staticPortalImage;
    break;
    imageContainer.addChild(thumbNailImage);
    texttest.text = fileSuffix;
    ]]>
    </Script>
    <Text id="texttest" />
    <HBox id="imageContainer" height="80" />
    </HBox>

    Thanks
    Great article I ended up getting rid of the creationcomplete
    changing my init():void too override public function set data(
    value:Object ) : void
    and adding
    super.data = value;
    I was able then to clean up my code considerably.
    Once again Thanks
    Dean

  • Accessing S:List Checkbox Item Renderer Outside the Renderer

    Hi All,
    I have an S:List, with a checkbox item renderer.  I was to be able to access the selected portion of the renderer to create a new function that at the press of a button this will delect all the current selected items in the list.
    Doco states that i should be able to do this just by setting the selectedIndex to -1.  But not sure if this is specific to 4.5??  But it is not working for me.
    Below is my current list.  Outside of this list flashbuilder does not know about chkList, or even selected.  How can i get access to this to deslect all?
    <s:List
    id="ltattributes">
    <s:itemRenderer>
    <fx:Component>
    <s:ItemRenderer>
    <fx:Script>
    <![CDATA[
    import mx.events.ItemClickEvent;
    protected function chkList_changeHandler(event:Event):void
    var e:ItemClickEvent = new ItemClickEvent(ItemClickEvent.ITEM_CLICK, true);
    data.selected = event.currentTarget.selected;
    e.item = data;
    e.index = itemIndex;
    dispatchEvent(e);
    ]]>
    </fx:Script>
    <s:CheckBox id="chkList" selected="false" label="{data.displayname}" change="chkList_changeHandler(event)"/>
    </s:ItemRenderer>
    </fx:Component>
    </s:itemRenderer>
    Thanks

    Try: dataGroup.getElementAt(). 
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • Flex Mobile List Item Renderer problems

    i have flex mobile list created with item renderer,i remove individual item in flex mobile list,it is worked very well,but some times i double click action or another scroll event using in list, last item doesn't delete in flex mobile list.it is repeated again and again.so anyone this problem faced,give me a solution.
    i expect your feedback.Thanking You

    Hi Alex,
    I've searched a lot for that post (on this forum and on google). Not sure if this is the post you were talking about: http://tech.groups.yahoo.com/group/flexcoders/message/161146
    I have fixed the setter of the data not to also manage the state (I figured it was inappropriate there)... overrode the getCurrentRendererState, I'm managing the state staight from the data. When I run the following... All sold items show as sold... and normal states show as normal. When I try to hover over the normal state, it dosen't play the hovered state, and when I click to the selected state. These built in states don't work.
    override public function set data(value:Object):void {
         super.data = value;
         ticketNumber_ti.text = value.slots_id;
    override protected function getCurrentRendererState():String {
         var state:String;
         if (data.date_purchased != null) {
              state = 'sold';
              mouseChildren = false;
              mouseEnabled = false;
         }  else {
              state = 'normal';
              mouseChildren = true;
              mouseEnabled = true;
         return state;
    On another note, the states only update, once I start scrolling, everything updates... I tried to validateDisplayList() to the List after setting the dataProvider with no luck.
    Once I find a solution I will certainly add it to my Blog as I have not found a lot of solutions for this problem.
    Any help is grteatly appreciated.

  • Zoom item renderer out of scroller boundaries

    Hi everyone, hoping someone has the easy Answer.  I want to have an item renderer that can zoomIn and display outside the scroller boundaries for which it resides in. 
    I have
    Scroller  set depth property =1
    |
    Datagroup (tile layout) depth=2
    |
    custom zoomable LabelItemRenderer depth=3  (depth=4 when zooming in so it overlaps the other renderers in the datagroup) ....these tiles, when zoomed, will increase in size by 50%.
    So in other words, the datagroup is wrapped in a scroller, and I extended the LIR to zoom.
    If I take the scroller out of the picture, everything works great...if I zoom on an IR(tile) that is on the very border of the datagroups boundaries, it will display over the DG's boundaries so that the whole zoomed tile is shown.
    Now if I wrap the DG in a scroller, the IRs will zoom, but any tiles on the boundary will get clipped by the boundary, like it is underneath the scroller.
    I want a zoomed tile to display completely, even if that means overlapping the boundaries of the scroller.  Like I said, works great when the DG doesn't have a scroller wrapped around it.
    Is this possible?
    I should add its a 4.6 mobile project.

    I don't use jbuilder
    This is what apears at the commandpromt:
    Exception occurred during event dispatching:
    java.lang.OutOfMemoryError
            <<no stack trace available>>
    Exception occurred during event dispatching:
    java.lang.OutOfMemoryError
            <<no stack trace available>>
    java.lang.OutOfMemoryError
            <<no stack trace available>>
    java.lang.OutOfMemoryError
            <<no stack trace available>>This is the version of java i use (I use the compiler that comes with it it does not answer to -version itself)
    java version "1.3.1"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-b24)
    Java HotSpot(TM) Client VM (build 1.3.1-b24, mixed mode)This is my ListCell renderers get method:
         public Component getListCellRendererComponent(JList list,Object value,int index,boolean isSelected,boolean cellHasFocus)
              String[] ss=((arrayjanus) value).getArray();
              JPanel p=new JPanel();
              p.setLayout(new BoxLayout(p,BoxLayout.X_AXIS));
              for(int i=0;i<lenghts.length;i++)
                   JTextField jt=new JTextField(lenghts);
                   jt.setText(ss[i]);
                   jt.setCaretPosition(0);
                   p.add(jt);
              return p;
    I run in the same problem if i switch of the DB access and on a selection do nothing but System.out.println the count of selections (I get it after ~ 800 clicks in rapid succession under theese circumstances)
    I am having about 50 items in the list.

  • Using multiple data points in an item renderer?

    I have a datagrid, bound to data from an XML file. My XML has
    multiple items,such as:
    <book>
    <title></title>
    <author></author>
    <description></description>
    <cover>someimage.jpg</cover>
    </book>
    I need to display each book as a unit, something like:
    [image] Moby Dick
    Herman Melville
    A long book about a whale.
    How would I accomplish this? Obviously, I can easily display
    the discrete info in columns, but I'd like to lay it out as one
    unit.
    Thanks.

    Use a list control instead of a datagrid. Then use a custom
    item renderer based on HBox or VBox depending on your preference
    for horizontal or vertical layout... possibly even just a Box
    control so you can change it at your whim.

  • 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

Maybe you are looking for