0 Replies Latest reply on Jun 18, 2012 8:43 AM by deepsheep1

    Having a problem with NavigatorContent and Visibility

    deepsheep1

      I have been working on this for more than a day, so it's time for some help...  I'm not a Flex/Flashbuilder expert, so any help is appreciated...

       

      I've got a NavigatorContent object that I want to set the visibility on based on the content of the object.  Bascially, if it is empty, I don't want to show it.  However, no matter what I do, I can't actually get the visibility to change.  It's ALWAYS visible.  I've checked the .visibile property and it IS set correctly, but I can still see the tab.  So, if I get the childNavReports.visible, it will say "false" but still display...

       

      Here's the code where it's built:

      var childNavReports:NavigatorContent = new NavigatorContent();
      childNavReports.name="assessment_reports"

      childNavReports.percentWidth = 100;
      childNavReports.percentHeight = 100;
      childNavReports.minWidth = 780;
      childNavReports.minHeight = 150;
      childNavReports.maxHeight = 170;
      childNavReports.visible=false;
      loadReportTree(childNavReports,graphic,layer); //this is where it's populated
      childNavReports.visible=false;
      childNavReports.enabled=false;
      childNavReports.includeInLayout=false;

      tabNavAssessment.addElement(childNavReports);

       

      I've even tried the following:
      childNavReports.setStyle("visibility", "hidden;");
      tabNavAssessment.getChildByName("assessment_reports").visible=false;
      tabNavAssessment.getTabAt(tabNavAssessment.getItemIndex(tabNavAssessment.getChildByName(" assessment_reports"))).visible=false;
      tabNavAssessment.getTabAt(tabNavAssessment.getItemIndex(tabNavAssessment.getChildByName(" assessment_reports"))).enabled=false;
      tabNavAssessment.getTabAt(tabNavAssessment.getItemIndex(tabNavAssessment.getChildByName(" assessment_reports"))).includeInLayout=false;
       
      Global.getLogger(this).info("childNavReports.visible added to tabs"+ childNavReports.visible.toString());

      tabNavAssessment.getChildByName("assessment_reports")

      tabNavAssessment.getTabAt(2).visible=false;  // 2 is the correct index
      tabNavAssessment.getTabAt(2).includeInLayout=false;
      tabNavAssessment.getTabAt(2).enabled=false;

       

      Any ideas?  Or work arounds?