title: How can we create linkbuttons whose text is data-driven, but whose visibility is controlled from the front-end?
body: <p>I've made a component based on a mx:TitleWindow that contains linkbuttons that I'm using as a context-menu.</p>
  
  <p>The TitleWindow component contains link buttons like this:</p>
  
  <pre><code>[Bindable]
  private var _showEmailThis:Boolean = false;
  
  [Bindable]
  private var _showApproveThis:Boolean = false;
  
  [Bindable]
  private var _showReviewThis:Boolean = false;
  
  &lt;mx:LinkButton id="lnkEmailThis" 
                 visible="{_showEmailThis}" 
                 includeInLayout="{_showEmailThis}" 
                 click="lnkEmailThis_click()" 
                 label="Email this!" /&gt;
  
  &lt;mx:LinkButton id="lnkApproveThis" 
                 visible="{_showApproveThis}" 
                 includeInLayout="{_showApproveThis}" 
                 click="lnkApproveThis_click()" 
                 label="Approve this!" /&gt;
  
  &lt;mx:LinkButton id="lnkReviewThis" 
                 visible="{_showReviewThis}" 
                 includeInLayout="{_showReviewThis}" 
                 click="lnkReviewThis_click()" 
                 label="Review this!" /&gt;
  </code></pre>
  
  <p>This component contains a large number of links and is re-used by multiple modules in the same application.</p>
  
  <p>Within each module, this component is used when a user clicks on a row in a datagrid.</p>
  
  <p>The code looks like this:</p>
  
  <p>In "Requests" module:</p>
  
  <pre><code>private function dgRequests_click(event:MouseEvent):void
  {
      menu.showApproveThis = true;
      menu.showReviewThis = true;
  }
  </code></pre>
  
  <p>In "Performance" module:</p>
  
  <pre><code>private function dgPerformance_click(event:MouseEvent):void
  {
      menu.showEmailThis = true;
      menu.showReviewThis = true;
  }
  </code></pre>
  
  <p>As you can see, the visibility of individual linkbuttons is controlled within each module by setting boolean properties. </p>
  
  <p>If I alter this component to use a renderer, how can I control the visibility of the linkbuttons from the code in each module (there are over a hundred links with different functionality - not every link will be used in each module)? <strong>Note: it is not known from the back-end which grid within which module uses which link. This is set in the front end within each module's actionscript file.</strong></p>
  
  <p>e.g., if the XML looks like this:</p>
  
  <pre><code>&lt;links&gt;
     &lt;link&gt;
        &lt;label&gt;Email This&lt;/label&gt;
        &lt;visible&gt;_showEmailThis&lt;/visible&gt;
     &lt;/link&gt;
     &lt;link&gt;
        &lt;label&gt;Approve This&lt;/label&gt;
        &lt;visible&gt;_showApproveThis&lt;/visible&gt;
     &lt;/link&gt;
     &lt;link&gt;
        &lt;label&gt;Review This&lt;/label&gt;
        &lt;visible&gt;_showReviewThis&lt;/visible&gt;
     &lt;/link&gt;
  &lt;/links&gt;
  </code></pre>
  
  <p>and I set the Email link to show in the module like this:</p>
  
  <pre><code>private function dgPerformance_click(event:MouseEvent):void
  {
      menu.showEmailThis = true;
  }
  </code></pre>
  
  <p>How do I make it take effect? Is there a way to control the visibility of a linkbutton within an item renderer in a component from the module that uses that component? </p>