Hi, I am using JSF with Primefaces. I have a long task, during which I want to show the user a progress bar, as an indicator - progress (int) and status (String). Two parameters are mapped to two bean backend fields. If I use
<p:poll> , I can update both, as in the following code:
<p:progressBar id="progress" ajax="false" value="#{backendBean.progress}" widgetVar="pbAjax" labelTemplate="{value}%: #{backendBean.statusMessage}" style="width:400px; font-size:12px"/> <p:poll interval="1" id="poll" autoStart="false" update="progress" widgetVar="pbPoll"/>
As soon as the user clicks the button, pbPoll.start() . It works great. Now I have two questions:
(1) Is it possible to hide the progress bar first? I know that I can put display: none in css and not show when the button is pressed. But updating the survey will again hide the progress indicator. Maybe use rendered. If yes, please tell me how.
(2) can be used without polling since progressBar has ajax function? Please note that in the above code I set ajax = false. On its website, it says that a dynamic progress label has been added . I tried, but somehow on the label only "{value}%" is displayed without statusMessage. Interestingly, this is due to the fact that #{statusMessage} requires a different selection, therefore it is ignored, and both are retrieved in the survey.
Thanks!
user996616
source share