-
1. Re: rich:progressBar not included with seam?
damianharvey.damianharvey.gmail.com Aug 15, 2008 11:22 AM (in response to ganix)Show your code. It does work. Chances are that it's just not rendering.
Cheers,
Damian.
-
2. Re: rich:progressBar not included with seam?
ganix Aug 19, 2008 4:19 PM (in response to ganix)the richfaces .jars supplied with seam 2.0.3.CR1 definitively lacks of the rich:progressBar tag. it is simply not included in the rich namespace.
Can you tell me please, which richfaces version includes the progressBar, and that you know is working with seam?
the code of the xhtml page is just like the live demo at exadel. i can paste it here:
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich"> <h:form> <a4j:outputPanel id="progressPanel"> <rich:progressBar value="#{progressBarBean.currentValue}" interval="2000" label="#{progressBarBean.currentValue} %" enabled="#{progressBarBean.enabled}" minValue="-1" maxValue="100" reRenderAfterComplete="progressPanel"> <f:facet name="initial"> <br /> <h:outputText value="Process doesn't started yet" /> <a4j:commandButton action="#{progressBarBean.startProcess}" value="Start Process" reRender="progressPanel" rendered="#{progressBarBean.buttonRendered}" style="margin: 9px 0px 5px;" /> </f:facet> <f:facet name="complete"> <br /> <h:outputText value="Process Done" /> <a4j:commandButton action="#{progressBarBean.startProcess}" value="Restart Process" reRender="progressPanel" rendered="#{progressBarBean.buttonRendered}" style="margin: 9px 0px 5px;" /> </f:facet> </rich:progressBar> </a4j:outputPanel> </h:form> </ui:composition>
as mentioned above, using richfaces-ui-3.2.1.GA-bin.zip,
there is no error at the jboss server log.
my bean method is called, some javascript message gets rendered at the place of the progressBar tag in the rendered html page. but nothing is visible in the browser.
:( -
3. Re: rich:progressBar not included with seam?
ganix Aug 21, 2008 5:33 PM (in response to ganix)Maybe someone has a working example code for the progressBar using seam 2.0.3.CR1. I would be very grateful if someone could post it here.
Even if it just shows up with a fixed value, without referencing a seam component, this would help me very much.
-
4. Re: rich:progressBar not included with seam?
damianharvey.damianharvey.gmail.com Aug 21, 2008 7:25 PM (in response to ganix)The following works well for me and I'll be using it in my app. Note that it's a mix of the client and ajax approaches. It seems more logical to me as your progress bar can be somewhere else on the page (eg. in the modal).
<h:form id="form"> <rich:modalPanel tridentIVEngineSelectBehavior="hide" id="progressBarModal" height="50" width="220" zindex="2000"> <h:outputText value="Progress:"/> <rich:progressBar id="progressBarTest" value="#{testProgBar.progress}" interval="500" label="#{testProgBar.progress} %" enabled="false" minValue="0" maxValue="100"/> </rich:modalPanel> <a:commandButton action="#{testProgBar.go()}" value="Go" onclick=" Richfaces.showModalPanel('progressBarModal'); $('form:progressBarTest').component.setValue(0); $('form:progressBarTest').component.enable();" oncomplete=" $('form:progressBarTest').component.disable(); Richfaces.hideModalPanel('progressBarModal');"/> </h:form>
And a basic Bean:
@Name("testProgBar") @Scope(ScopeType.PAGE) public class TestProgBar { private int progress = 0; public void go() { System.out.println("Starting Progress Test"); progress = 0; while(progress < 100) { try { Thread.sleep(100); } catch(InterruptedException e) {} progress++; System.out.println("Progress = "+progress); } System.out.println("Finished Progress Test"); } public int getProgress() { return this.progress; } public void setProgress(int progress) { this.progress = progress; } public static void main(String[] args) { new TestProgBar().go(); } }
Points to note :
- Scope your Bean so that the polling is calling the same Bean as what is running (ie. don't use ScopeType.EVENT)
- The setValue() javascript method seems to restart the polling so don't do this after you complete the action or your polling will just keep on trucking.
- I had some issues with the bar not rendering when the min value is zero and you don't set a value. Setting the min to -1 seemed to clear this up (As you can see I didn't need it in the end).
Hope this helps.
Cheers,
Damian.