Flex SDK 3.4 Tree Item Renderer Root Folder displays Tooltip for Child

I have a Flex Tree that uses a custom item renderer.  The item renderer extends Tree Item Renderer and I add my button in commit properties (since the data is dynamic) and I use update displaylist to move it to the right position.  I set the button to be visible on rollover and make the icon invisible. On rollout I reverse that logic.
When I have my item renderer add the button, it causes only one problem and it seems to be under certain conditions:
- Single root folder for the tree
- Upon opening the tree, the root folder displays the tool tip for the last child in the tree
Any idea why the tooltip comes up?
public function AssetTreeItemRenderer ()
            super();
            addEventListener(MouseEvent.ROLL_OVER, onItemRollover);
            addEventListener(MouseEvent.ROLL_OUT, onItemRollout);
            addEventListener(ToolTipEvent.TOOL_TIP_SHOWN, toolTipShown);
            addEventListener(ToolTipEvent.TOOL_TIP_CREATE, onCreateToolTip);
        // OVERRIDEN FUNCTIONS
         * override createChildren
        override protected function commitProperties():void {
            super.commitProperties();
            if(data is IAsset) {
                if(playBtn === null) {
                    playBtn = new Button();
                    playBtn.styleName = "previewPlayButton";
                    playBtn.toolTip = "Play";
                    playBtn.width = icon.width + 2;
                    playBtn.height = icon.height + 2;
                    playBtn.visible = false;
                    playBtn.addEventListener(MouseEvent.CLICK, onPlayBtnClick);
                    addChild(playBtn);
            } else {
                if(playBtn !== null) {
                    removeChild(playBtn);
                    playBtn = null;
         * override updateDisplayList
         * @param Number unscaledWidth
         * @param Number unscaledHeight
        override protected function updateDisplayList(unscaledWidth:Number,
                                                      unscaledHeight:Number):void
            super.updateDisplayList(unscaledWidth, unscaledHeight);
            //Move our play button to the correct place
            if(super.data && playBtn !== null)
                playBtn.x = icon.x;
                playBtn.y = icon.y;

You are not clearing tooltip if data is not IAsset

Similar Messages

  • Tree cell renderer shows (...) for long texts

    I know that the BasicTreeUI saves a cache but I don't know how to reset this cache, or if there is another solution
    Best regards
    Dekel

    My tree is inside jscrollpane.Ok, then I don't understand why your renderer truncates the displayed text.
    how can I set the jlabel prefered size to be in the
    exact width of the String ?AFAIK, this is the default behavior, i.e. you do not do anything.
    (I don't want to see a gap between the label and the end of the
    string when a node is selected)Uhm, I have no idea what "gap" you are talking about. I don't see any "gaps" when I select nodes in a JTree.

  • DataGrid used as Tree Item Renderer

    Has anyone out there used a DataGrid as an itemRenderer for
    the leaf nodes in a tree? I am attempting to do so by extending the
    TreeItemRenderer class. Do I have to make a DataGrid custom
    component to use?

    Renderers of word-wrapping text must set their measuredHeight based on
    explicitWidth of the renderer.
    See
    http://blogs.adobe.com/aharui/2010/10/mx-datagrid-list-and-variablerowheight
    .html
    It applies to Tree as well.

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

  • Flex SDK Download server is down.

    Incase no one at Adobe is aware, none of the downloads work for any of the files found at:
    http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4
    Select an item to download, click the checkbox and once you click on the "Download Zip" link you get an error everytime, regardless of which file you are trying to download.  I've tried off and on all morning and have had the same result each time.
    Here is the error message for the latest full nightly build:
    The requested URL /pub/flex/sdk/builds/Flex4/4.0.0.7573/flex_sdk_4.0.0.7573.zip was not found on this server.
    Apache/2.0.52 (Unix) Server at download.macromedia.com Port 8000

    Thanks!   I noticed the whole site was down for a bit and is now back up.    Just wanted to be clear that this was not my initial problem - it was just the flex sdk 3.1  - which is still not available, at least for me.

  • Datagrid Item renderer Help

    Hi all,
    I need a help/suggestion in a datagrid item renderer. In a datagrid, for one particular cell (particular column of a row) i need to change the background color depending upon the condition.The color for particular cell not for the entire row or entire column, how can i achieve this ?
    Thanks in advance.
    Heman

    Here is my Scenario, in my datagrid the second column of the first row (987.93) background color depends upon some condtion. The remaning rows of column B depends upon the column C . If "the column C is OK" it will be green , "NOT OK" red. But the first row's second column color depends upon some other condition. How can i achieve this ?

  • How to hide messagetextinput item on root node in HGRID

    Hi,
    I have added one messagetextinput item in HGRID.
    But it is showing 3 items(one for root node, 2 for the actual items) when there are 2 rows in master node.
    +Employee          |________|
    -101 |________|
    -102 |________|
    I want to hide the item at root node(i.e. for employee.)
    I am working on seeded page, not the custom page.
    Can someone help me..
    --Parag                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Add a switcher in Hgrid, Create 2 items in switcher. One is input type and other is styled text. Switch the values of switcher based on condition from VO.
    For detailed help, feel free to mail me at [email protected]
    OAHGridBean hGridBean =
    (OAHGridBean)webBean.findChildRecursive("QotLinesHGridRN");
    if (hGridBean != null) {
    OASwitcherBean switcherbean =
    (OASwitcherBean)createWebBean(pageContext, SWITCHER_BEAN, null,
    "DellPriceSwitcher");
    switcherbean.setLabel("Dell Auth. Unit Price");
    switcherbean.setViewAttributeName("Attribute20");
    switcherbean.setViewUsageName("QuoteLinesLevel70VO1Obj");
    hGridBean.addIndexedChild(9, switcherbean);
    //Add dell auth unit price text input item
    OAMessageTextInputBean inputbean =
    (OAMessageTextInputBean)createWebBean(pageContext,
    MESSAGE_TEXT_INPUT_BEAN,
    null,
    "DellAuthPriceinp");
    OAMessageStyledTextBean styledbean =
    (OAMessageStyledTextBean)createWebBean(pageContext,
    MESSAGE_STYLED_TEXT_BEAN,
    null,
    "DellAuthPricestyled");
    inputbean.setReadOnly(false);
    inputbean.setViewAttributeName("Attribute1");
    inputbean.setViewUsageName("QuoteLinesLevel70VO1Obj");
    styledbean.setViewAttributeName("Attribute1");
    styledbean.setViewUsageName("QuoteLinesLevel70VO1Obj");
    inputbean.setColumns(5);
    switcherbean.setNamedChild("DellAuthPriceinp", inputbean);
    switcherbean.setNamedChild("DellAuthPricestyled", styledbean);

  • Xcelsius 2008 and Flex SDK

    Hello all,
    I'm new to Xcelsius and Flex SDK and I don't get any information about that:
    For what do I exactly need Flex SDK? Only if I want to implement a new template for Xcelsius like a "better" property-panel?
    I also want to know, when I want to store data out of my dashboard, can I use and handle them directly in a Web Dynpro environment?
    Does anyone have experience with that or could help?
    Thanks in advance
    best wishes, Bonita

    Hi Bonita,
    Xcelsius provides standard set of visual components, but in some situation we might need some functionality that is note there in standard set of components. That is where flex comes into picture with the help of Flex SDK we can develop custom components and then use the Xcelsius SDK to compile and use that as an add on inside Xcelsius. Custom build components are also available in marketplace (we can opt from a large set of variants, developed in Flex & Xcelsius SDK). Flex coding is mostly done in MXML and events are Handeled with Action Script.
    Note : We need Flex SDK along with Xcelsius SDK only when we need to create some custom component. Xcelsius SDK can be downloaded from SAP Website or can be installed during Setup installation.
    Data can be exported out of Xcelsius with the help of External Interface connection. Sample is available in the extracted installation file. Data exchange is Handeled with scripting language. Don't know Web Dynpro  environment supports the scripting or not.
    Good Luck

  • Flex SDK Download - checksum error

    Hello,
    I downloaded the Flex SDK from
    http://www.adobe.com/products/flex/downloads/
    When I unzip it (with WinRAR), I get a checksum error.
    Any advice?
    Thanks.

    Thanks!   I noticed the whole site was down for a bit and is now back up.    Just wanted to be clear that this was not my initial problem - it was just the flex sdk 3.1  - which is still not available, at least for me.

  • [svn:fx- flex] 21426: Moved flex/sdk/tags/trunk to flex/sdk/tags/trunk4.5.1 .

    Revision: 21426
    Revision: 21426
    Author:   [email protected]
    Date:     2011-06-21 07:15:10 -0700 (Tue, 21 Jun 2011)
    Log Message:
    Moved flex/sdk/tags/trunk to flex/sdk/tags/trunk4.5.1. This tag has history for the 4.5.1 release
    Added Paths:
        flex/sdk/tags/trunk4.5.1/
    Removed Paths:
        private/flex/sdk/tags/trunk/

    I had downloaded it for test, and requested for evaluation license...
    But I haven't got license, and also I am not able to find Flash Builder Plugins from HFCD site....
    I think those plugins are removed from site....
    Please help me, if anyone have those plugins...

  • 57F4 challan print - getting parent item no and po number for child item

    Hi ,
    In 57F4 challan, Subcontract components - i.e Child items are used for creating the challans.
    However while printing needs the parent item no with the purchase order number for that child item number.
    It is getting stored in RM07M structure.
    Any inputs / suggestions how to retrive parent item number and purchase order number for child item i.e for subcontract items?
    Thank you .
    Prasad.

    Thank you for the reply. I checked the table RSEG table for material document and PO details, however the RSEG gets populated when there is credit or debit entries.
    In this 57F4 challan there is no credit or debit enteries hence would not get in RSEG table.
    Appreciate your inputs for any other alternative.
    OR is there any table or Function Module to get the enteries of the struture of RM07M .

  • Flex Using Tree Control in item renderer(Url Navigate)?

    HI All.,
                Iam Using flex 3 using tree control in item renderer to click haschildren label to be navigate url is possible ?.
    Any one help me.....
    Thanks in Advance......

    You can do this by writing the item's tag to the ActiveItemTag property, the column number you're intersted in to the ActiveColNum property and reading the Cell String Property.
    Mike....
    PS: If anybody at NI is listening, that interface really, really, REALLY needs to get rewritten...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps
    Attachments:
    tree_properties.vi ‏9 KB

  • Maybe Flex SDK bug: Setting visible of DataGrid item renderers

    Hi all, I'm still a noob at flex but this looks a bit strange to me.
    I've been trying to hide a button renderer in a DataGrid but it just wouldn't hide.  I've been setting visible inside the mxml and also in the the class that extends buttonbut it just wouldn't hide.  I then overloaded the visible property set/get and traced what was setting the property to true and found that inside DataGridBase.as the function setupColumnItemRenderer always sets visible of the renderes to true.
    DataGridBase.as
    protected function setupColumnItemRenderer(c:DataGridColumn, contentHolder:ListBaseContentHolder,
                        rowNum:int, colNum:int, data:Object, uid:String):IListItemRenderer
            var listItems:Array = contentHolder.listItems;
            var item:IListItemRenderer;
            var rowData:DataGridListData;
            item = listItems[rowNum][colNum];
            if (!item || itemToUID(item.data) != uid
                || columnMap[item.name] != c)
                item = createColumnItemRenderer(c, false, data);
                if (item == null)
                    return null;
                if (item.parent != contentHolder)
                    contentHolder.addChild(DisplayObject(item));
                // a space is used if no data so text widgets get some default size
                columnMap[item.name] = c;
                if (listItems[rowNum][colNum])
                    addToFreeItemRenderers(listItems[rowNum][colNum]);
                listItems[rowNum][colNum] = item;
            //[Matt] moved from inside the block above to outside because
            //the item definitely exists at this point, and always needs
            //its data refreshed
            rowData = DataGridListData(makeListData(data, uid, rowNum, c.colNum, c));
            rowMap[item.name] = rowData;
            if (item is IDropInListItemRenderer)
                IDropInListItemRenderer(item).listData = data ? rowData : null;
            item.data = data;
            item.visible = true;
            if (uid && colNum == 0)
                contentHolder.visibleData[uid] = item;
            return item;
    Why does it do this?  Shouldn't it respect the visible property already set for the renderer in mxml and not force it to true on init?

    Renderers use the visible property for recycling.  Invisible renderers are not supported.  The hit detection logic would find it the cell it belongs to even if it was invisible.  You can set alpha=0, but it won't stop the hit detection logic.
    Why are you trying to hide a renderer?
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • Flex 3 Item renderer in List dissapear and shifted place

    I successfully added ItemRenderer in my List but whenever I scroll down to the bottom and scroll up again. The ItemRenderer in the List would be either gone or shifted places.
    I have search up on possible solution but they doesn't seen like working. I tried to put dataChange=”validateNow()” in the ItemRenderer but it doesn't work. I read something about useVirtualLayout="false" but it seen like my List doesn't have useVirtualLayout ?
    <mx:List
            id="rowsList2" width="{VBoxCall.width}" height="{ scheduleViewerHeight }"
            rowHeight="{ scheduleViewer.rowHeight }"
            verticalScrollPolicy="off" verticalAlign="middle"
             horizontalScrollPolicy="off"
            alternatingItemColors="[0xEEEEEE, 0xDFDFDF]" itemRenderer="RendererState">
            <!-- Example to showcase Item renderer -->
            <mx:dataProvider>
                <mx:Object label="Mr Swabby"
                           data="Juneau"
                           webPage="http://www.state.ak.us/"/>
                <mx:Object label="Mrs Harrington"
                           data="Montgomery"
                           webPage="http://www.alabama.gov/" />
            </mx:dataProvider>
        </mx:List>
    Before (picture) http://i.stack.imgur.com/VxoeP.gif
    After (picture) http://i.stack.imgur.com/3qHO9.gif
    Any Ideas ?
    Regards, Mike

    Hi Alex,
    I've read your blog but I still could find the solution.
    I tried to override the set data but it is not working. Whenever I scroll to the bottom and move up again, all the buttons are gone.
    Please advise me on this.
    Regards,
    Mike
    <?xml version="1.0" encoding="utf-8"?>
    <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml">   
              <mx:Script>
                        <![CDATA[
                                  // Import Event and URLRequest classes.
                                  import flash.events.Event;
                                  import flash.net.URLRequest;
                                  override public function set data(value:Object):void{
                                            if(value != null)
                                            super.data = value;
                                            if(data.label == null)
                                                      Button.label="";
                                            else
                                                      if(data.label == null || data.label=="")
                                                                Button.label = "";
                                                      else
                                                                Button.label = data.label;
                                            else
                                                      myVBox.removeChild(Button);
                        ]]>
              </mx:Script>
              <mx:VBox id="myVBox">
                        <mx:Button id="Button" width="90">
                        </mx:Button>
              </mx:VBox>
    </mx:VBox>

  • 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

Maybe you are looking for