primefaces commandbutton update does not work

2019-03-02 09:45发布

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!

2条回答
萌系小妹纸
2楼-- · 2019-03-02 09:56

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.

查看更多
Juvenile、少年°
3楼-- · 2019-03-02 09:58

Use : before id


Remember


  1. If you make a dialog.

  2. Before Dialog old form tag should be closed.

  3. Then dialouge content should be placed into another form.

  4. Use update=":dialougeid, :dialougeFormId"

查看更多
登录 后发表回答