views:

397

answers:

1

Hi,

I've got a progressBar component defined as the following on my webpage:

<rich:modalPanel id="pb1Panel">
    <rich:progressBar id="pb1" oncomplete="javascript:#{myBean.handleProgressEvent()} closeProgressModalPanel()" value="#{pb1Listener.percentageComplete}" label="#{pb1Listener.percentageComplete} %" minValue="1" maxValue="100" limitToList="true" timeout="3200" interval="1400" enabled="false"/>
</rich:modalPanel>

and a button:

<a4j:commandButton id="actButton" value="action" action="#{myBean.performAction}" immediate="true" ajaxSingle="true" onclick="javascript:Richfaces.showModalPanel('pb1Panel');" reRender="pb1Panel">
    <a4j:support event="onClick" value="#{rich:component('pb1')}.enable()" reRender="pb1" />
</a4j:commandButton>

which doesn't work. However if I take out the

....
   enabled="false"/>
....

from the progress bar, and the element from the button, everything seems to work just fine.

Any suggestion why it's not working? I'm setting enabled="false" initially because I do not want the polling to start unless the button was clicked (to reduce unnecessary polling).

The system is building on richfaces/seam.

Thanks!

+1  A: 

The enabled property should refer to a property of a managed bean, and your button should change it, then reRender the progress bar.

Simply copy-paste the example from here - it's doing exactly the same thing as you want.

Bozho