Progressbar doesn't work ...

UI Components for JSF
maxpade
Posts: 13
Joined: 22 Jun 2010, 17:24

07 Jul 2010, 16:00

Hi all,

i've inserted a progressbar but it doesn't work with 2.02 and even with snapshot 2.0.3. does anyone has an idea?

Code: Select all

<h:form>
..
<p:progressBar widgetVar="pbAjax" ajax="true" interval="1000" value="#{issuebean.count}" step="1" />
..
</h:form>
bean:

Code: Select all

    private int count = 0;

    public int getCount() {
        return this.count;
    }

    public void setCount(int count) {
        this.count = count;
    }

thanks maxpade

maxpade
Posts: 13
Joined: 22 Jun 2010, 17:24

07 Jul 2010, 16:02

i've forget to mention that the count value is incremented every time ;)

User avatar
michiel
Posts: 240
Joined: 07 Jun 2010, 09:12
Location: Belgium

07 Jul 2010, 16:30

you've set interval="1000", where interval =
"Interval in seconds to do periodic requests in ajax mode.",

this means your progressBar is updated every 1000 secs,
just try removing it
JSF-2.0, mojarra-2.0.2-FCS and PrimeFaces-2.1 on GlassFish v3.0.1 (build 22)

maxpade
Posts: 13
Joined: 22 Jun 2010, 17:24

07 Jul 2010, 16:48

Hi,

i thought the interval's value is in milliseconds.

but now i've deleted it and put additionally an outputtext. My outputtext is showing that the value is incremented but the progressbar is still not working.

<h:outputText id="crtCnt" value="Count increment: #{issuebean.count} "/>
<p:progressBar widgetVar="pbAjax" ajax="true" value="#{issuebean.count}"/>
<p:poll actionListener="#{issuebean.increment}" update="crtCnt" />


:(

User avatar
michiel
Posts: 240
Joined: 07 Jun 2010, 09:12
Location: Belgium

07 Jul 2010, 16:54

you need to provide some more info.

are you getting any error?
is the showcase working for you?
some more code (xhtml and managedBean)?
JSF-2.0, mojarra-2.0.2-FCS and PrimeFaces-2.1 on GlassFish v3.0.1 (build 22)

maxpade
Posts: 13
Joined: 22 Jun 2010, 17:24

07 Jul 2010, 17:47

Hi,


here i will list my whole sample code.
My problems are:
1. The progressbar couldn't be set to the given maxValue (5)
2. The progressbar is updated after the save method is finished, unlike the (ajax-polled) outputtext


Bean

Code: Select all

import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.event.ActionEvent;
/*
 * customer profile
 */
@ManagedBean
@SessionScoped
public class Customer {
	private int count;

	public int getCount() throws Exception{
		return count;
	}
	
	public void setCount(int count) {
		this.count = count;

	}
	
	public String save() throws Exception{
		//return "/showCustomer.xhtml?link=hallo";
				for(int i=0; i<4;i++){
		
			Thread.sleep(3000);
		setCount(i);
		}
		return null;
	}
	
    public void increment(ActionEvent actionEvent) {}

}
XHTML

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:h="http://java.sun.com/jsf/html"
		xmlns:p="http://primefaces.prime.com.tr/ui">
<h:head>
	<title>Customer</title>
</h:head>
<body>
    <h:form id="form">
		<p:progressBar widgetVar="pbAjax" ajax="true" value="#{customer.count}" minValue="0" maxValue="5" step="1" interal="1"/>
		<h:outputText id="cntId" value="Count: #{customer.count}"/>
        <h:commandButton id="save" action="#{customer.save}" value="Save"/>
		<p:poll actionListener="#{customer.increment}" update="cntId" />
    </h:form>

</body>
</html>
the showcase links aren't working for me. They're unreachable... but my sample code isn't big and should explain what i want.

thank you!!!

maxpade :D

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

08 Jul 2010, 10:33


maxpade
Posts: 13
Joined: 22 Jun 2010, 17:24

08 Jul 2010, 11:09

Hi optimus,

the link is unreachable...
maxpade

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

08 Jul 2010, 11:16

Are you behind a company proxy server?

maxpade
Posts: 13
Joined: 22 Jun 2010, 17:24

08 Jul 2010, 11:18

yes.. the proxy was filtering the port.... now i could reach the showcase..

the strange thing is, that my example is similar to the showcase but it doesn't work. just a couple of lines and not working :?

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 46 guests