primefaces commandbutton update does not work

感情迁移 提交于 2019-12-02 02:56:53

问题


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!


回答1:


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.




回答2:


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"



来源:https://stackoverflow.com/questions/21044983/primefaces-commandbutton-update-does-not-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!