primefaces commandbutton update does not work

user3178676 picture user3178676 · Jan 10, 2014 · Viewed 7.4k times · Source

I have minimized my code to better show you what is not working.

<h:body>
<f:view>
    <h:form id="wbSelectForm">
        <p:commandButton id="viewWorkbenchButton" icon="ui-icon-show"
            title="View Workbench" update=":wbTestPanel"
            actionListener="#{WorkbenchControllerBean.test}">
        </p:commandButton>
    </h:form>

    <p:panel id="wbTestPanel">
            Test: Active Wb: #{WorkbenchControllerBean.number}
    </p:panel>
</f:view>
</h:body>

When i press the commandButton, i would expect that 'wbTestPanel' is being updated, which does somehow NOT happen. I know that because WorkbenchControllerBean.getNumber() is not called.

I am using primefaces 3.5. I already tried differend values for 'process'-attribute as well as putting RequestContext.getCurrentInstance().update("wbTestPanel")in WorkbenchControllerBean.test()-method.

I think that maybe the code is right, but there are any settings in the project or runtime environment (Java 7 + JBoss 7.1.1) that prevent primefaces from updating the other panel. Could you please give me a hint what to search for?

Thanks in advance!

Answer

itasyurt picture itasyurt · Jan 10, 2014

Are you sure that test() method is invoked? If yes, can you try with following update expression?

update="@([id$=wbTestPanel])"

Otherwise, it maybe the case that test() method is not called because of a validation error. If that is the case, you can inspect it with debug or firebug.