我无法在p:对话框中执行h:form的ajax更新。这是我的xhtml的设计。我没有嵌套表单。PrimeFaces p:对话框中的ajax更新不起作用
MainPage.xhtml有相应的managedBean - > MainPageBean。
SearchView.xhtml包含managedBean - > searchViewBean。
MainPage.xhtml
3210searchView.xhtml
<h:form prependId='false' id='sv_dataForm'>
...
<p:messages id="sv_messagesId" for="errorMessages" closeable="true" />
<p:inputText value="#{searchViewBean.lastName}" id="lastName" required="true" />
<p:commandButton value="Search" action="#{searchViewBean.search}" update=":sv_dataForm" ajax="true" />
<h:outputText value='#{searchViewBean.numberOfCustomers}' />
...
</h:form>
当MainPage.xhtml一个按钮被点击它显示一个p:对话框。 p:对话框包含SearchView.xhtml。 SearchView.xhtml包含一个表单。当对姓氏进行简单搜索时,numberOfCustomers被确定。当我调试代码时,我可以在searchViewBean的numberOfCustomers中看到值,但是p:dialog没有更新。但是,如果我有任何验证错误,我可以看到p:消息得到显示。我不知道为什么p:对话框正在更新。如果我做错了,请告诉我。
谢谢。
嗨Konum我没有嵌套形式。其实我发现这个问题,但stackoverflow不允许我回答我自己的问题,因为我没有足够的声誉。 – sreekarN
Ups,我不知道为什么我在那里看到嵌套窗体。很高兴你得到它的工作。 –