title: What's the best way to expand a panel with JSF?
body: <p>I would like to expand my panel that is working fine based on some condition(f.e. the value of a variable in my bean).</p>
  
  <p>this is the code:</p>
  
  <pre><code>&lt;button data-toggle="collapse" data-target="#demo"&gt;collapse&lt;/button&gt;
  
  &lt;div class="panel-body collapse" id="demo"&gt;
  my text
  &lt;/div&gt;
  </code></pre>
  
  <p>I know that to expand and keep it expanded I should use the "in" like </p>
  
  <pre><code>&lt;button data-toggle="collapse" data-target="#demo"&gt;collapse&lt;/button&gt;
  
  &lt;div class="panel-body collapse in" id="demo"&gt;
  my text
  &lt;/div&gt;
  </code></pre>
  
  <p>How can I manage it by code from JSF?</p>
  
  <p>I did something like that and it works: </p>
  
  <pre><code>&lt;div class="panel-body collapse #{Bean.toExpand}" id="demo"&gt;
  my text
  &lt;/div&gt;
  </code></pre>
  
  <p>where #{Bean.toExpand} will contain the value "" or "in" in order to set during rendering that.</p>
  
  <p>Do you think this is a good approach? Can it be improved?</p>