如果有人能给我一些关于进度条和ajax后端处理的提示,我将不胜感激.
澄清我需要遵循的细节:
我有一个命令按钮在后端进行一些处理.我想在支持bean完成处理后端指令时显示一个达到100%的进度条.我看了很多线程,但没有运气.他们中的大多数都没有展示具体的样本如何做到这一点.以下是我的代码片段:
</h:panelGrid>
<p:commandButton id="btn" value="DoSomeAction"
styleClass="ui-priority-primary" update="panel"
onclick="PF('pbAjax').start();PF('startButton1').disable();"
widgetVar="startButton1"
actionListener="#{actionBean.DoSomeAction}" />
<p:progressBar widgetVar="pbAjax" ajax="true"
value="#{progressBean.progress}" labelTemplate="{value}%"
styleClass="animated">
<p:ajax event="complete" listener="#{progressBean.onComplete}"
update="growl" oncomplete="startButton2.enable()" />
</p:progressBar>
</p:panel>
Run Code Online (Sandbox Code Playgroud)
这是Progress Brean的代码:
@ManagedBean(name="progressBean")
public class ProgressBean implements Serializable {
private Integer progress;
public Integer getProgress() {
if(progress == null)
progress = 0;
else {
progress = progress + (int)(Math.random() * 35);
if(progress > 100)
progress = 100;
}
return progress;
}
public void setProgress(Integer progress) {
this.progress = progress;
}
public void onComplete() …Run Code Online (Sandbox Code Playgroud) 如何从文本文件中读取字符串并存储在散列映射中?文件包含两列.
文件就像:
标题en_CA
1根据您的保单的法定条件,我们必须告知您保单的保险范围将在收到此信件后15天的上午12:01停止生效.
列(如Title和en_CA或1和In ...)由制表符分隔,而不是空格.
谢谢