简体   繁体   English

通过进度条显示分钟进度

[英]Show minute progress by progress bar

I want to use the primefaces progress bar to show a certain duration which is inputted by the user: 我想使用素数进度条显示用户输入的特定持续时间:

public Integer getProgress() {       
    if(progress == null) {          
        progress = 0;      
    }        else {          
        progress = progress + (int)(Math.random() * 35); //I giess that is now true for the example of 60 min
        if(progress > 100)          
            progress = 100;        }          
    return progress;  
}

This is what my ProgressView looks like at the Moment. 这就是我的ProgressView当时的样子。 Any recommendation how to change the progress bar to show for example a 60 minute duration? 是否有任何建议如何更改进度条以显示例如60分钟的持续时间?

I appreciate your answer! 感谢您的回答!

Just bind your value attribute on your progress bar to progress in your backing bean and set the interval attribute to something suitable (it defaults to 300s) 只要您绑定value进度条上的属性,以progress的支撑bean和设置interval属性合适的东西(默认为300秒)

<p:progressBar id="progressBarClient" value="#{bean.progress}" interval="10" widgetVar="pbClient" style="width:300px"/>

Reference 参考

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM