title: Primefaces dynamic label for progressbar
body: <p>Hi I am using JSF with Primefaces. I have a long task, during which I want to show user a progress bar, with the progress (int) and status (String) as an indicator. The two parameters are mapped to the two fields of a backend bean. If I use <code>&lt;p:poll&gt;</code>, I can update both, as in the following code:</p>
  
  <pre><code>&lt;p:progressBar id="progress" ajax="false" value="#{backendBean.progress}" widgetVar="pbAjax"
    labelTemplate="{value}%: #{backendBean.statusMessage}" style="width:400px; font-size:12px"/&gt;
  &lt;p:poll interval="1" id="poll" autoStart="false" update="progress" widgetVar="pbPoll"/&gt;
  </code></pre>
  
  <p>Once user press a button, <code>pbPoll.start()</code>. This works fine. Now I have two questions:</p>
  
  <p>(1) is it possible to hide the progressbar initially? I know I can put display:none in the css and let it show up when the button is clicked. But the poll update will hide the progressbar again. Maybe use rendered. If so, please tell me how.</p>
  
  <p>(2) can I use without poll since progressBar has ajax function itself? Notice that I set ajax=false in the code above. <a href="http://blog.primefaces.org/?p=1765">On their website, it says "dynamic progress label" is added</a>. I tried but somehow the label only displays the <code>"{value}%"</code> without the statusMessage. I wonder if this is because <code>#{statusMessage}</code> requires another fetch, therefore ignored, while both are retrieved in poll.</p>
  
  <p><strong>Thank!</strong></p>