Note that there are some explanatory texts on larger screens.

plurals
  1. POrich:progressBar currentValue does not working with For-Loop?
    primarykey
    data
    text
    <p>In RichFaces 4.1, rich:progressBar 'currentValue' from the ManagedBean does not updating with for-loop.</p> <p>progressBar.xhtml</p> <pre><code> &lt;h:form id="formProgress"&gt; &lt;h:commandLink action="#{progressBarBean.startProcess}" value="click here"/&gt; &lt;rich:progressBar mode="ajax" value="#{progressBarBean.currentValue}" interval="1000" id="pb" enabled="#{progressBarBean.enabled}" minValue="0" maxValue="100"&gt; &lt;h:outputText value="Retrieving #{progressBarBean.currentValue} of #{progressBarBean.totalRecords}" /&gt; &lt;/rich:progressBar&gt; &lt;/h:form&gt; </code></pre> <p>Bean</p> <pre><code>package ap; import java.io.Serializable; import javax.faces.bean.ManagedBean; import javax.faces.bean.ViewScoped; @ManagedBean @ViewScoped public class ProgressBarBean implements Serializable { private static final long serialVersionUID = 8775622106408411357L; private boolean enabled = false; private Integer totalRecords; private Integer currentValue;; public String startProcess() { setEnabled(true); setTotalRecords(100); return null; } public Integer getCurrentValue() { if (isEnabled()) { for(currentValue=0;currentValue &lt; totalRecords;) { currentValue++; } } return currentValue; } public boolean isEnabled() { return enabled; } public void setEnabled(boolean enabled) { this.enabled = enabled; } public Integer getTotalRecords() { return totalRecords; } public void setTotalRecords(Integer totalRecords) { this.totalRecords = totalRecords; } } </code></pre> <p>When i click the 'click here' link, the currentValue updates very fastly and reaches the totalRecords to 100 suddenly. It was not updating in the incremental way(present value in for-loop). The progress bar is not updated by the present value return by the method. </p> <p>Any help please.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload