4 Replies Latest reply: Apr 14, 2011 11:10 AM by Flex harUI RSS

    Unable to receive ArrayCollection Data in Custom Tooltip

    Ameya Mogare

      Hi,

       

      I have developed a custom tooltip component as follows: -

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"
          implements="mx.core.IToolTip" width="400" height="300"
          backgroundColor="#FFF8C6"
          cornerRadius="10" horizontalAlign="center" paddingTop="10">
      <mx:Script>
          <![CDATA[
              [Bindable]
              public var arrayCol:Object;
              [Bindable]
              public var hdrText:String;

              //  Implement required methods of the IToolTip interface;

       

              //  these methods are not used in this example, though.
              public var _text:String;
              public function get text():String {
                  return _text;
              }
              public function set text(value:String):void {
              }
          ]]>
      </mx:Script>

          <mx:Text text="{hdrText}" width="100%" textAlign="left" fontWeight="bold"/>

       

          <mx:DataGrid dataProvider="{arrayCol}" width="100%" editable="false" backgroundColor="#FFF8C6"
                       verticalGridLines="false" horizontalGridLines="false"
                       textAlign="left" showHeaders="false" verticalScrollPolicy="off" horizontalScrollPolicy="off"
                       fontSize="10" color="#000000" rowCount="-1"
                       />
      </mx:VBox>

       

      And I am calling it on a Repeater's Text UI components as follows: -

       

      In script: -

                  private function createCustomToolTip(event:ToolTipEvent, item:Object):void {
                     
                      var toolTip:SkillCustomTooltip = new SkillCustomTooltip();
                      var cName : String = item.getRepeaterItem().sgname;
                      toolTip.hdrText = cName;
                     
                      if(cName == "Activities"){
                          toolTip.arrayCol = Activities;
                      }else if(cName == "Business Processes"){
                          toolTip.arrayCol = BusinessPro;
                      }else if(cName == "Industries"){
                          toolTip.arrayCol = Industr;
                      }else if(cName == "Language"){
                          toolTip.arrayCol = Languages;
                      }else if(cName == "Methods and Standards"){
                          toolTip.arrayCol = MedStands;
                      }else if(cName == "Offerings"){
                          toolTip.arrayCol = Offerings;
                      }else if(cName == "Products"){
                          toolTip.arrayCol = Products;
                      }
                      event.toolTip = toolTip;
                  }

       

      In mxml : -

      <mx:Repeater id="rptSkillGroups" dataProvider="{SkillGroups}">
           <mx:LinkButton label="{rptSkillGroups.currentItem.sgname}"
                                            color="#0095A7" fontWeight="bold" textAlign="left" 
                                            toolTip=" "
                                            toolTipCreate="createCustomToolTip(event, event.currentTarget)"/>
      </mx:Repeater>

       

      But at runtime, my datagrid in custom tooltip is empty.

       

      Note:

      1. all arraycollections that inside if/else blocks above are single column arraycollections with different column names.

      2. arraycollections are mapped to WD context nodes with valid data.

       

      Please help.

       

      Thanks and regards,

      Amey