Custom Item Renderer Issue for List

Hi,
I have a List that uses a custom renderer that contains a
combo box and a checkbox.
If i define the data provider inline in MXML both the
combobox and the checkbox render values correctly.
However, if I switch the dataprovider to an AS 3.0
ArrayCollection using same name/value pairs, the checkbox renders
properly but the combo box doesn't show text values. What is weird
is that if I trace the data, the value is accessible but it won't
show in combo.text of control.
Any ideas?

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.

Similar Messages

  • 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.

  • Need for a Datagrid with variableRowHeight="true" and custom Item Renderer to display exact rows

    Hi again, developers:
    I'm in a search of a datagrid  with certain characteristics:
         - variableRowHeight = "true"
         - only one column
         - each row must have a custom item renderer with possibly different heights, and a fixed width
         - the datagrid must show always every item in the data provider with no vertical scroll bars, what means that the datagrid height must have always the exact height sum of all the item renderers it is displaying.
         - and no extra empty rows must appear in the last positions of the datagrid
    The last two requirements are something difficult to achieve... for some reason, empty rows appear at the last positions of the datagrid. I post what i've managed to get:
    <mx:Script>
         <![CDATA[
         private function resize():void
                    if (dg.dataProvider)
                        var h:Number = dg.measureHeightOfItems( -1, dg.dataProvider.length);
                        dg.height = h;
         ]]>
    </mx:Script>
    <mx:DataGrid id="dg" width="530" horizontalCenter="0" verticalScrollPolicy="off"
            dataProvider="{dp}"
            wordWrap="true" variableRowHeight="true" showHeaders="false" dataChange="resize()" height="{dg.measureHeightOfItems(-1,dg.dataProvider.length)}" click="Alert.show(dg.rowCount.toString());">
            <mx:columns>
                <mx:DataGridColumn headerText="ID" width="50">
                    <mx:itemRenderer>
                        <mx:Component>
                            <mx:TextArea height="{Math.random()*100}" wordWrap="true" backgroundColor="{Math.random() * 16777216}" paddingTop="0" paddingBottom="0"/>
                        </mx:Component>
                    </mx:itemRenderer>
                </mx:DataGridColumn>
            </mx:columns>
        </mx:DataGrid>

    Thanks Harui, but it doesn't help. If the border is set it will help, but the very big problem is the empty rows that appear at the end of the datagrid... I can't find a way of measuring correctly the height of the itemRenderers!
    I'll update this thread if I manage to do it.

  • 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

  • Range component in custom item renderer

    Hi,
    I am trying to put a spark Range component into the labelItemRenderer for flex mobile. Everytime I add it I get the error: "Skin for (long directory name for my range component) cannot be found". The custom item renderer is an actionscipt class because I read this is the best way to make them for mobile. I'll put the error in the bottom of the post.
    If anyone has any idea why this could be happening or if anyone knows a possible way around this it would be extremely helpful. I basicaly just need a list where each item has a label on side and then a progress bar on the other side.
    Thanks.
    Here is the full error, ill put a star on the line where the addChild method gets called in my item renderer for the range component.
    Error: Skin for HoosFit0.TabbedViewNavigatorApplicationSkin5.tabbedNavigator.TabbedViewNavigatorSkin7.con tentGroup.ViewNavigator1.ViewNavigatorSkin12.contentGroup.
    FCfacilities139.SkinnableContainerSkin141.contentGroup.Group143.facilityList.ListSkin145.S croller147.ScrollerSkin148.DataGroup146.FCfacilitiesInnerClass0_157.Range154 cannot be found.
              at spark.components.supportClasses::SkinnableComponent/attachSkin()[E:\dev\4.y\frameworks\pr ojects\spark\src\spark\components\supportClasses\SkinnableComponent.as:698]
              at spark.components.supportClasses::SkinnableComponent/validateSkinChange()[E:\dev\4.y\frame works\projects\spark\src\spark\components\supportClasses\SkinnableComponent.as:443]
              at spark.components.supportClasses::SkinnableComponent/createChildren()[E:\dev\4.y\framework s\projects\spark\src\spark\components\supportClasses\SkinnableComponent.as:406]
              at mx.core::UIComponent/initialize()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UI Component.as:7634]
              at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::childAdded()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:7495]
              at mx.core::UIComponent/addChild()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UICo mponent.as:7176]
    *** at views::itemRenderer2/set data()[/Users/evan/Documents/Adobe Flash Builder 4.6/HoosFit/src/views/itemRenderer2.as:73]
              at spark.components::SkinnableDataContainer/updateRenderer()[E:\dev\4.y\frameworks\projects\ spark\src\spark\components\SkinnableDataContainer.as:606]
              at spark.components.supportClasses::ListBase/updateRenderer()[E:\dev\4.y\frameworks\projects \spark\src\spark\components\supportClasses\ListBase.as:1106]
              at spark.components::DataGroup/setUpItemRenderer()[E:\dev\4.y\frameworks\projects\spark\src\ spark\components\DataGroup.as:1157]
              at spark.components::DataGroup/initializeTypicalItem()[E:\dev\4.y\frameworks\projects\spark\ src\spark\components\DataGroup.as:327]
              at spark.components::DataGroup/ensureTypicalLayoutElement()[E:\dev\4.y\frameworks\projects\s park\src\spark\components\DataGroup.as:384]
              at spark.components::DataGroup/measure()[E:\dev\4.y\frameworks\projects\spark\src\spark\comp onents\DataGroup.as:1467]
              at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::measureSizes()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:8506]
              at mx.core::UIComponent/validateSize()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\ UIComponent.as:8430]
              at mx.managers::LayoutManager/validateSize()[E:\dev\4.y\frameworks\projects\framework\src\mx \managers\LayoutManager.as:665]
              at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.y\frameworks\projects\framewo rk\src\mx\managers\LayoutManager.as:816]
              at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.y\frameworks\projects \framework\src\mx\managers\LayoutManager.as:1180]

    Hi,
    I am trying to put a spark Range component into the labelItemRenderer for flex mobile. Everytime I add it I get the error: "Skin for (long directory name for my range component) cannot be found". The custom item renderer is an actionscipt class because I read this is the best way to make them for mobile. I'll put the error in the bottom of the post.
    If anyone has any idea why this could be happening or if anyone knows a possible way around this it would be extremely helpful. I basicaly just need a list where each item has a label on side and then a progress bar on the other side.
    Thanks.
    Here is the full error, ill put a star on the line where the addChild method gets called in my item renderer for the range component.
    Error: Skin for HoosFit0.TabbedViewNavigatorApplicationSkin5.tabbedNavigator.TabbedViewNavigatorSkin7.con tentGroup.ViewNavigator1.ViewNavigatorSkin12.contentGroup.
    FCfacilities139.SkinnableContainerSkin141.contentGroup.Group143.facilityList.ListSkin145.S croller147.ScrollerSkin148.DataGroup146.FCfacilitiesInnerClass0_157.Range154 cannot be found.
              at spark.components.supportClasses::SkinnableComponent/attachSkin()[E:\dev\4.y\frameworks\pr ojects\spark\src\spark\components\supportClasses\SkinnableComponent.as:698]
              at spark.components.supportClasses::SkinnableComponent/validateSkinChange()[E:\dev\4.y\frame works\projects\spark\src\spark\components\supportClasses\SkinnableComponent.as:443]
              at spark.components.supportClasses::SkinnableComponent/createChildren()[E:\dev\4.y\framework s\projects\spark\src\spark\components\supportClasses\SkinnableComponent.as:406]
              at mx.core::UIComponent/initialize()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UI Component.as:7634]
              at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::childAdded()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:7495]
              at mx.core::UIComponent/addChild()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UICo mponent.as:7176]
    *** at views::itemRenderer2/set data()[/Users/evan/Documents/Adobe Flash Builder 4.6/HoosFit/src/views/itemRenderer2.as:73]
              at spark.components::SkinnableDataContainer/updateRenderer()[E:\dev\4.y\frameworks\projects\ spark\src\spark\components\SkinnableDataContainer.as:606]
              at spark.components.supportClasses::ListBase/updateRenderer()[E:\dev\4.y\frameworks\projects \spark\src\spark\components\supportClasses\ListBase.as:1106]
              at spark.components::DataGroup/setUpItemRenderer()[E:\dev\4.y\frameworks\projects\spark\src\ spark\components\DataGroup.as:1157]
              at spark.components::DataGroup/initializeTypicalItem()[E:\dev\4.y\frameworks\projects\spark\ src\spark\components\DataGroup.as:327]
              at spark.components::DataGroup/ensureTypicalLayoutElement()[E:\dev\4.y\frameworks\projects\s park\src\spark\components\DataGroup.as:384]
              at spark.components::DataGroup/measure()[E:\dev\4.y\frameworks\projects\spark\src\spark\comp onents\DataGroup.as:1467]
              at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::measureSizes()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:8506]
              at mx.core::UIComponent/validateSize()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\ UIComponent.as:8430]
              at mx.managers::LayoutManager/validateSize()[E:\dev\4.y\frameworks\projects\framework\src\mx \managers\LayoutManager.as:665]
              at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.y\frameworks\projects\framewo rk\src\mx\managers\LayoutManager.as:816]
              at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.y\frameworks\projects \framework\src\mx\managers\LayoutManager.as:1180]

  • How to dispatch custom events from an item renderer used for Datagrid Column

    Hi,
    I am using an Item Renderer for a Data Grid Column and in that mxml, I am dispatching a custom event with data.
    But the main mxml which has the DataGrid is not able to resolve the event. How can I solve this?
    Thanks

    Hi,
    This is the constructor for Event.
    public function Event(type:String, bubbles:Boolean  = false, cancelable:Boolean  = false)
    When you created your custom event after extending from Event, for the parent container receives the event, the bubbles property must be set to true.
    Please check if you have done so. That should solve the problem. Let me know if it doesn't.
    Nishad

  • Custom Cell Renderer issue in Custom JTable

    I have CustomeTable extends JTable which renders different UI Components like (JTextField/ ComboBox /JButton/JCheckBox) in *"single column*" so i have overridden *getCellRenderer* and *getCellEditor methods.*
    Now my Custom Table changes contextually by selecting different nodes in JTree similar to Windows Explorer
    *The problem is Some times When i Click Button & then i click other Node which displays other UIComponents old components (Button is painted) instead of new COmponent(JTextfield or ...)*
    *For each UI Renderer i have called its repaint() method still this issue is noticed not frequentlly but yes occasionally.*

    Following are some of my Custom Text / Combo Renderer / Password / Button to display different UI Components @ Column 2 as per my above Code
    private class MyDefaultRenderer implements TableCellRenderer {
            private JTextField l;
            private Border borderPrevious;
            public MyDefaultRenderer() {
                l = new JTextField();
                borderPrevious = l.getBorder();
            public Component getTableCellRendererComponent(JTable table,
                    Object value,
                    boolean isSelected,
                    boolean hasFocus,
                    int row,
                    int column) {
                PropertyInfoType propertyType = propertyInfoList.get(row).getType();
                if (ConfigCommonPropertyPanel.isInputEditable && !propertyInfoList.get(row).isReadOnly()) {
                String tempVal = "";
                if (value != null && value instanceof String) {
                    tempVal = value.toString();
                l.setText(tempVal);
                l.setOpaque(true);
                l.revalidate();
                l.repaint();
                return l;
            public Object getCellEditorValue() {
                return l.getText();
           private class ButtonRenderer implements TableCellRenderer {
            JPanel buttonPanel;
            JButton button;
            public ButtonRenderer() {
                buttonPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
                button = new JButton(getAdminUIMsg(168));
                buttonPanel.setOpaque(true);
                buttonPanel.add(button);
         public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
                button.setFont(LNFManager.getThemeForComponent(table).getBodyText());
                buttonPanel.setPreferredSize(new Dimension(getPreferredSize().width, getRowHeight()));
                buttonPanel.revalidate();
                buttonPanel.repaint();
                return buttonPanel;
        private class ButtonEditor extends JButton implements TableCellEditor, ActionListener {
            int rowIndex;
            int columnIndex;
            JTable table;
            JPanel panel;
            public ButtonEditor() {
                super("Validate Database");
                panel = new JPanel(new FlowLayout(FlowLayout.LEFT));
                addActionListener(this);
            public Component getTableCellEditorComponent(JTable table, Object value,
                    boolean isSelected, int row, int column) {
                rowIndex = row;
                columnIndex = column;
                setOpaque(true);
                panel.setOpaque(true);
                panel.setPreferredSize(new Dimension(getPreferredSize().width, getRowHeight()));
                setFocusable(true);
                panel.repaint();
                panel.add(this);
                return panel;
            public Object getCellEditorValue() {
                return this.isSelected();
            public boolean isCellEditable(EventObject anEvent) {
                return true;
            public boolean shouldSelectCell(EventObject anEvent) {
                return true;
            public boolean stopCellEditing() {
                return true;
            public void cancelCellEditing() {
            public void addCellEditorListener(CellEditorListener l) {
            public void removeCellEditorListener(CellEditorListener l) {
            public void actionPerformed(ActionEvent e) {
                              try{
    // Some Business Logic To check my Database / LDAP Connections on Button Click
                                 }catch( Exception ex){
                                  } finally{
                                            stopCellEditing();
                                            transferFocus();
                   +Shouldnt i call repaint() on a specific Component for a Specific renderer ?+
    My Code works perfectly 99 % of the times ..
    But very rarely when i click My Button On my Custom Table say
    When i click NODE A - which displays different UI in Right Split Info
    Row 2 Column 2 - has Validate Button
    Then i Click NODe B - Which displayes Contextual UI Components
    Row 2 Column 2 should display TextBox (as expected)
    but due to some rendering issue its Displaying same Validate Button
    I have debugged and verified my logic to call renderer is perfect.
    My rest of rows /columns displays appropriate UI Components except the
    position of Button .
    I think after my Button Editor is Invoked & i perform some business logic Button renderer is not getting invoked ???

  • How to set item level permission for list item in SharePoint 2013

    Hi we had a custom List "ABC".
    List had 2 columns:
    Project Name: (P1, P2, P3, P4, P5, P6)
    Project Leads: (PL1, PL2, PL3, PL4, PL5, PL6).
    All project Leads can have permission to edit only their Project (P1, P2, P3) like
    PL1 can edit P1
    PL2 Can edit P2.....
    But my Question is how to restrict PL2 cannot have permission to edit P1
    is it possible to set permission for this through OOTB in SharePoint 2013.
    Any help will be appreciated......

    Hi
    check this similar post
    http://social.technet.microsoft.com/Forums/ro-RO/e1ea3655-0c6f-4b3d-a336-c42e8eb54c09/rights-to-edit-own-items-for-list-residing-on-publishing-site?forum=sharepointdevelopmentprevious
    Romeo Donca, Orange Romania (MCSE, MCITP, CCNA) Please Mark As Answer if my post solves your problem or Vote As Helpful if the post has been helpful for you.

  • Item renderer issue

    Hi,
    I have a comboBox as item renderer in my datagrid (comboBox item renderer code bellow).
    1. How can I remove the first blank item? My comboBox arrayCollection doesn't have 0 item.
    2. If I come back to the cell that it was already selected with a value from my comboBox, how can I set the selected item of my comboBox to be the same as the previus value? If I leave the comboBox without selection it will be blank as the 0 element.
    Please help.
    Thanks
    Johnny
    <?xml version="1.0" encoding="utf-8"?>
    <mx:ComboBox xmlns:mx="http://www.adobe.com/2006/mxml"
                 labelField="label" dataProvider="{acCombo}" rowCount="20"
                 change="onSelectionChange(event)" creationComplete="init()">
        <mx:Script>
            <![CDATA[
                import mx.collections.ArrayCollection;
                import mx.controls.dataGridClasses.DataGridListData;
                import mx.events.ListEvent;
                import mx.rpc.events.ResultEvent;
                [Bindable]private var acCombo:ArrayCollection = new ArrayCollection ([{id:1, label:"Item 01"},{id:2, label:"Item 02"},{id:3, label:"Item 03"},
                    {id:4, label:"Item 04"},{id:5, label:"Item 05"}]);
                private var _ownerData:Object;
                public function init():void
                    //init code
                override public function set data(value:Object):void
                    if (value){
                        _ownerData = value as Object;
                        var col:DataGridListData = DataGridListData(listData);
                        var item:Object = new Object;
                        var clabel:String = value[col.dataField];
                        var cid:int = value.id;
                        item.label = clabel;
                        item.id = cid;
                        selectedItem = item;
                override public function get data():Object
                    return _ownerData;
                override public function setFocus():void
                    super.setFocus();
                    open();
                private function onSelectionChange(e:ListEvent):void
                    if(selectedItem && _ownerData){
                        var col:DataGridListData = DataGridListData(listData);
                        var clabel:String = selectedItem.label;
                        var cid:int = selectedItem.id;
                        _ownerData[col.dataField] = clabel;
                        _ownerData[id] = cid;
            ]]>
        </mx:Script>
    </mx:ComboBox>

    Hi,
    I created a sample, maybe someone can see the issue for me
    Thanks!
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" viewSourceURL="srcview/index.html"
                    creationComplete="init()">
        <mx:Script>
            <![CDATA[
                import mx.events.CollectionEvent;
                import mx.events.DataGridEvent;
                import com.myItemEditor;
                import mx.collections.ArrayCollection;
                [Bindable] private var acExecution:ArrayCollection = new ArrayCollection([
                    {Territory:"Arizona", Territory_Rep:"Barbara Jennings", ITEM_ID:1, ITEM_NAME:"Item 01"},
                    {Territory:"Central California", Territory_Rep:"Joe Smith", ITEM_ID:2, ITEM_NAME:"Item 02"},
                    {Territory:"Nevada", Territory_Rep:"Bethany Pittman", ITEM_ID:2, ITEM_NAME:"Item 02"}, 
                    {Territory:"Northern California", Territory_Rep:"T.R. Smith", ITEM_ID:1, ITEM_NAME:"Item 01"},
                    {Territory:"Southern California", Territory_Rep:"Jane Grove", ITEM_ID:3, ITEM_NAME:"Item 03"}
                private function init():void
                private function onItemEditEnd(e:DataGridEvent):void
                    var cEditor:myItemEditor = dgCustomEditor.itemEditorInstance as myItemEditor;
                    var item:Object = cEditor.selectedItem;
                    acExecution.refresh();
            ]]>
        </mx:Script>
        <mx:DataGrid id="dgCustomEditor" dataProvider="{acExecution}" height="160"
                     editable="true" itemEditEnd="onItemEditEnd(event)">
            <mx:columns>
                <mx:DataGridColumn headerText="Territory" dataField="Territory" width="60"
                                   editable="false"/>
                <mx:DataGridColumn headerText="Territory Rep" dataField="Territory_Rep" width="60"
                                   editable="false"/>
                <mx:DataGridColumn headerText="Item ID" dataField="ITEM_ID" width="60"
                                   editable="false"/>
                <mx:DataGridColumn headerText="Item Name" dataField="ITEM_NAME" width="160" itemEditor="com.myItemEditor" />
            </mx:columns>
        </mx:DataGrid>
    </mx:Application>
    Item Editor component
    <?xml version="1.0" encoding="utf-8"?>
    <mx:ComboBox xmlns:mx="http://www.adobe.com/2006/mxml"
                 labelField="LABEL" dataProvider="{acCombo}" rowCount="20"
                 change="onSelectionChange(event)" creationComplete="init()">
        <mx:Script>
            <![CDATA[
                import mx.events.ListEvent;
                import mx.controls.dataGridClasses.DataGridListData;
                import mx.rpc.events.ResultEvent;
                import mx.collections.ArrayCollection;
                [Bindable]private var acCombo:ArrayCollection = new ArrayCollection ([{ID:1, LABEL:"Item 01"},{ID:2, LABEL:"Item 02"},{ID:3, LABEL:"Item 03"},
                    {ID:4, LABEL:"Item 04"},{ID:5, LABEL:"Item 05"}]);
                private var _ownerData:Object;
                private function init():void
                    //init code
                override public function set data(value:Object):void
                    if (value){
                        _ownerData = value as Object;
                        var col:DataGridListData = DataGridListData(listData);
                        var item:Object = new Object;
                        var clabel:String = value[col.dataField];
                        var cid:int = value["ITEM_ID"];
                        item.LABEL = clabel;
                        item.ID = cid;
                        selectedItem = item;
                override public function get data():Object
                    return _ownerData;
                override public function setFocus():void
                    super.setFocus();
                    open();
                private function onSelectionChange(e:ListEvent):void
                    if(selectedItem && _ownerData){
                        var col:DataGridListData = DataGridListData(listData);
                        var clabel:String = selectedItem.LABEL;
                        var cid:int = selectedItem.ID;
                        _ownerData[col.dataField] = clabel;
                        _ownerData["ITEM_ID"] = cid;
            ]]>
        </mx:Script>
    </mx:ComboBox>

  • Changing values in custom item renderer

    I have an xml feed that I am using to populate a List control. The list control has it's itemRenderer property set to CustomListItem which a custom component built by me to display various pieces of data from the xml along with an icon. At certain points I would like to ba able to tell one of the fields in CustomListItem to change from displaying xml.firstData to xml.secondData depending on a radio button selection but I can't find a way to access the properties of CustomListItem from main.mxml (which is where the radio buttons are).
    At the moment the values in CustomListItem are set using functions within it to parse the 'data' property.
    Sorry if this is a bit of a sketchy explanation of my problem Any suggestions would be great.
    Cheers

    I hope this code represents your situation, but at least I hope it helps you!
    ----------------------- main app ----------------------------
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" width="100%"
      height="100%" creationComplete="dataRequest.send();"
      xmlns:comp="*" horizontalAlign="left">
      <mx:Script>
        <![CDATA[
          import mx.rpc.events.ResultEvent;
          import MyListItems;
          import mx.collections.XMLListCollection;
          [Bindable] private var xmllist:XMLList;
          [Bindable] private var xlc:XMLListCollection;
          private function resultHandler(evt:ResultEvent):void{
            xmllist = evt.result.item;
            xlc = new XMLListCollection(xmllist.firstData);
          private function changeData(evt:Event):void{
            if(evt.currentTarget.label == "First Data"){
              xlc = new XMLListCollection(xmllist..firstData);         
            }else{
              xlc = new XMLListCollection(xmllist.secondData);         
        ]]>
      </mx:Script>
      <mx:HTTPService id="dataRequest" useProxy="false" url="data.xml"
        resultFormat="e4x" result="resultHandler(event)"/>
      <mx:RadioButtonGroup id="items"/>
      <mx:RadioButton group="{items}" label="First Data" change="changeData(event)"
        selected="true"/>
      <mx:RadioButton group="{items}" label="Second Data" change="changeData(event)"/>
      <mx:List width="100" height="150" itemRenderer="MyListItems"
        dataProvider="{xlc}"/>
    </mx:Application>
    ----------------------- item renderer --------------------------
    <?xml version="1.0" encoding="utf-8"?>
    <mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml">
      <mx:Text text="{data}"/>
    </mx:HBox>
    ------------------------------- data.xml ---------------------------
    <?xml version="1.0" encoding="utf-8"?>
    <mydata>
      <item>
        <firstData>apples</firstData>
        <secondData>oranges</secondData>
      </item>
      <item>
        <firstData>beef</firstData>
        <secondData>chicken</secondData>
      </item>
      <item>
        <firstData>milk</firstData>
        <secondData>juice</secondData>
      </item>
      <item>
        <firstData>carrot</firstData>
        <secondData>tomato</secondData>
      </item>
    </mydata>

  • Help with datagrid custom item renderer

    Hi ,
    I have a datagrid in which I have a column with a checkbox and a custom Checkbox header renderer and an item renderer.
    When I try to disable the grid the checkbox column does not get disabled?
    Is there any way I can disable the entire grid along with the checkbox column?
    Thanks.

    Override updateDisplayList on the renderer and set the .enabled to match
    owner.enabled.

  • How can I use the CustomEvent in custom Item Renderer

    Hi all.
    I have a small problem, which i must solve.
    I have a ImageRenderer - TileList with a custom ItemRenderer.
    When I choose a picture a button appears (in the ItemRenerer) and when I click it it throws an event with the name of the picture.
    The Problem is, that i can not add an event Listener to the ItemRenderer.
    Can anybody help me to resolve this problem?

    But how can I catch it in the top of the list??????
    The ItemRenderer is a IFactory Class Object, which has only one function newInstance().
    I repeat it again, there is no addEventListener or something else for the ItemRenderer.
    I can give you only a header of the code because it is a big project (and if somebody have a solution or an example, maybe he could give me the it, please)
    <?xml version="1.0" encoding="utf-8"?>
    <mx:TileList xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="init();"
         dataProvider="{imageList}"
         labelField="label"
         iconField="thumbnail"
         itemRenderer="{new ClassFactory(ThumbnailRenderer)}" verticalScrollPolicy="auto">......
    and the renderer
    <?xml version="1.0" encoding="utf-8"?>
    <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"
              horizontalAlign="center" verticalAlign="middle" creationComplete="init()"
              xmlns:DataModels="DataModels.*"
              click="selectedHandler()" height="125">
         <mx:Image source="{data.thumbnail}"
                  width="80"
                  height="50"                    horizontalCenter="0"
                     verticalCenter="0" horizontalAlign="center" verticalAlign="middle"/>
         <mx:Label text="{data.label}"
                   horizontalCenter="0"
                   bottom="0" />
         <mx:Metadata>
             [Event(name="addImageEvent", type="DataModels.AddImageEvent")]
        </mx:Metadata>
    The button is created dynamicly. When i clicked it, then i dispatch a new AddImageEvent
    like this
    ...button.addEventListener(MouseEvent.CLICK, dispatchAddImageEvent);...private function dispatchAddImageEvent(event:Event):void{     var addImageEvent:AddImageEvent = new AddImageEvent(AddImageEvent.ADD_IMAGE_EVENT);     dispatchEvent(addImageEvent);}
    Inside the renderer i can catch it, because there is the addEventListener method, but not in the ITEMRENDERER (IFactory element)

  • Total Lack of Customer Service - Ongoing Issues for 8 Weeks

    Hi, I'm currently dealing with Comcast's legendarily awful customer support. I've tried a multitude of avenues, with the exception of this one, so in the hopes that maybe someone can help me here, this is what I've experienced in the past 8 weeks: June 1: Move into new townhouse. June 6: Attempt to setup Comcast internet and TV services through a 3rd party subscription company. $40/mo for Blast (50MB ) internet with a $75 VISA gift card, TV already provided through my HOA fees. Credit hard inquiry pulled for this subscription. Never got the $75 gift card. June 7: Attempt install of my own router/cable modem. Modem does not work. Spend several hours on the phone with various tech support and customer support employees. End result: no internet. June 8: Spend several hours on the phone with various tech support and customer support employees. End result: no internet. June 9: Spend several hours on the phone with various tech support and customer support employees. End result: 3rd party didn't actually create an account. Hard credit inquiry pulled (second one), $25/mo for 25MB internet and TV again included in HOA. Internet works, TV does not. June 10-16: Girlfriend (who is authorized on the account) attempts to pick-up cable boxes. Told that she cannot because she is not the account primary. After multiple phone calls to customer support, she finally is allowed to pick up the boxes. June 16-19: Attempt to install cable boxes, again with multiple customer service calls. Issue is traced to an incorrect rate code entered. Rate code correct, still doesn't fix cable boxes. End result: No TV June 20 to July 2: After multiple attempts to get cable boxes to communicate and failing, a tech visit was created. Tech visits house. My girlfriend was present for the appointment - I am an electrical engineer and did my best to explain to her what the issue is - there is a terminator at the external cable box preventing any signal from entering the house. She attempts to explain this to the tech, who dismisses her and says the issue is the satellite dish on the roof, which isn't even connected! July 18th: After trying to remove the terminator myself and failing, I call customer support and set up yet another tech visit. I am given a visit date of August 3rd (16 days later - completely insane), but promised that the agent will escalate the appointment and have someone call me back within "2 to 3 hours". I am still waiting on that particular callback. July 22nd: Spend multiple hours in online chat with 3 separate agents. My thought process was that by having everything in writing, maybe someone would actually do what they promised. I was promised bill credits for the unusable cable boxes and a callback within 24 hours to reschedule my appointment to an earlier date. Never got the correct amount credited, and I am again still waiting on that callback. July 27: Finally get aggravated enough to email the Executive Customer Care line. I am promised that I will hear from an agent within 24 hours.  July 28: Get an email from the agent in broken English, addressing me as "Mrs." XXXXX (I am definitely not a "Mrs.") and claiming that he tried to call me earlier in the day (I had no missed calls or voicemails, and I was not on my phone at all that morning). I email him back immediately and he promises to follow up with me. I hear nothing for 4 hours, so I email the executive customer service team again. Instead of directly helping me, the inform me that they'll update my ticket and let my agent know. An hour later, I finally get a call from the agent informing me that although it is the end of his work day (which somehow ends at 3:45pm), he will try to get my appointment moved and he will definitely credit my account. He tells me that if I don't hear from someone from the local dispatch team that day, I would definitely hear from him first thing the next morning (the 29th). Shockingly, I don't hear anything from the local dispatch team that evening. July 29th: Don't receive a callback from either the local dispatch team or the agent helping me. I sent several emails to the main executive customer service line and am only told that my ticket would be updated and my agent informed. That does me absolutely no good, since my agent isn't helping me! My account still hasn't been credited, I have the same appointment date, and I still have 2 hard credit pulls on my credit score! My problem isn't overly complex or difficult to deal with. I don't want to be a thorn in Comcast's side, but I am being pushed in that direction because no one is assisting me, just passing the buck from rep to rep until I fall through the cracks. I am going to have to file complaints with the FCC, FTC, and BBB because of the appalling lack of customer service. I bill over $70/hr for my time at work, and I have wasted at least 50 hours during working hours dealing with this. I don't think it's unreasonable to want my issues resolved promptly when I've basically flushed $3500+ down the drain dealing with pure incompetence. If there is anyone who can actually help (and I don't mean telling me that someone will call back in the next 48 hours - because I've already fallen for that ruse a dozens times or so), please get in touch with me.     

    Hi wth1,
    Sorry to hear about all the problems you had getting this resolved. I do see you were able to speak with someone yesterday who was able to assist you and come to a resolution. Please reach back out to us if you have any other issues. 
    Thank You

  • DataGrid custom header renderer issues

    I'm trying to create a DataGrid headerRenderer with a
    TextInput to filter the grid from the column. The custom renderer
    simply has a label (with the column header label) and then a text
    input, and it's all in AS, implementing IFactory, etc. It's
    rendering just fine.
    The issue is with the filtering - at first, I tried just
    adding the text box, but as soon as I typed anything in it, the
    filtering logic (which must call dataProvider.refresh() to refresh
    the dataGrid) caused the header to be re-instantiated, thereby
    clearing the filter text input field. I later worked around this by
    caching the TextInput objects elsewhere, and having the header
    simply addChild on them.
    However, the issue still gets in the way. The headerRenderer
    is reinstantiated twice per call to refresh(), causing it to blink,
    and if the user types too fast, it throws a RTE because the
    components haven't been instantiated yet.
    Is there a way to stop this incessant re-initialization of
    the headerRenderer? It doesn't seem necessary or efficient. If
    anyone knows or wants to help I would be very grateful.
    Thanks!

    This may be caused by the TextInput event you are using to
    call the filtering method. Are you call your filtering method from
    the TextInput's change event, perhaps? If so, each character being
    typed will call the filter method. Call your filtering method from
    the valueCommit event, and see if that helps.
    Put a break on the first line of your filter method, debug
    the app, start typing into the TextInput and watch what happens. If
    the filter method is called multiple times this could be the
    problem.
    Be sure you don't call the filter method until the typing is
    completed.

  • Datagrid Checkbox item renderer Issue.

    Hi There
    Recently I faced a  requirement to have a checkbox inside a datagrid where I need to develop a music module with playlist management for ADOBE AIR based application.
    For this I have searched and found a source to use Datagrid and Checkbox components which overrides some inbuild methods to give the required result..
    But Finally I ended with one strange issue
    When the check box is placed in the datagrid at 0 column index it works firne but if we place at any index ( I need it to be last colum ) the checkbox is not updating the display.
    Source Flex Air project attached.
    From the sample... While clicking on a row the left column checkbox is getting updated but Right remains same... when you scroll the Datagrid then the checkboxes are getting update when they are redrawn. I didn't found where to call the redraw for the right checkbox column.
    Cany any one faced this strange issue. and found any solution ?????
    If the Logic what I am following for a Playlist module is not good one then suggest if you guys know any other mechanism to develop a playlist management with datagrid and Checkboxes.
    Message was edited by: ChintuBabu

    Hi There
    Recently I faced a  requirement to have a checkbox inside a datagrid where I need to develop a music module with playlist management for ADOBE AIR based application.
    For this I have searched and found a source to use Datagrid and Checkbox components which overrides some inbuild methods to give the required result..
    But Finally I ended with one strange issue
    When the check box is placed in the datagrid at 0 column index it works firne but if we place at any index ( I need it to be last colum ) the checkbox is not updating the display.
    Source Flex Air project attached.
    From the sample... While clicking on a row the left column checkbox is getting updated but Right remains same... when you scroll the Datagrid then the checkboxes are getting update when they are redrawn. I didn't found where to call the redraw for the right checkbox column.
    Cany any one faced this strange issue. and found any solution ?????
    If the Logic what I am following for a Playlist module is not good one then suggest if you guys know any other mechanism to develop a playlist management with datagrid and Checkboxes.
    Message was edited by: ChintuBabu

Maybe you are looking for

  • How to use MS Office w/iCloud?

    Hi guys, I am using MS Office for Mac because of compatibility issues with my clients. IDisk worked just perfectly for me now I understand that I can retrieve my documents in the cloud thru iWorks only and not directly by "opening" the iDisk folder.

  • File to Idoc Scenario using third party systems

    hi, Working with a File to Idoc Scenario. Been able to successfully define everything in IR / ID. However when I go to BD87 (reciever system) and see the status of Idoc processed - getting the error code 51 "Function Module Not Allowed: <Function Nam

  • While trying to use iTunes on my iPad, it keeps closing itself. Why?

    While trying to search on iTunes, it just keeps closing itself. Why?

  • Create Integration Scenario - Step by Step

    Hi All, Can anyone guide me the step by step procedure for creating integration scenario in IR. Thanks Deno

  • 46TL868 problems (new Firmware?)

    Hi, i have several problems with my 46TL868 and wanted to install a new firmware because the Toshiba support said it would solve the problems. Problem is i can't find a place to download said firmware and i won't pay a lot of money just for someone t