我写了这段代码:
<p:dialog header="Bolletta" width="800" height="600">
<h:form id="newBillForm" >
<p:panel header="Dati fiscali">
<h:panelGrid columns="4">
<h:outputLabel value="Cliente *: " for="customer"/>
<p:autoComplete id="customer" value="#{billController.customerString}" completeMethod="#{customerController.autoComplete}" required="true"/>
</h:panelGrid>
</p:panel>
</h:form>
</p:dialog>
如果我将表单(及其所有内容)放在对话框之外,则 completeMethod 可以正常工作,但在对话框内它不起作用!
知道怎么做吗?
最佳答案
这可能有许多可能的原因,常见的原因是嵌套 <h:form>
组件或在输入或其父项之一上使用 rendered
属性,这些属性在表单提交期间评估 false
。有关所有这些的详细概述,请查看 commandButton/commandLink/ajax action/listener method not invoked or input value not updated
关于java - autoComplete completeMethod 在对话框中不起作用,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/7291961/