【问题标题】:autoComplete completeMethod doesn't work in dialog自动完成完成方法在对话框中不起作用
【发布时间】:2011-09-03 08:12:30
【问题描述】:

我写了这段代码:

<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 可以正常工作,但在对话框内它不起作用!

知道怎么做吗?

【问题讨论】:

  • 不,只是一个表单,但是这段代码在一个没有html标签的xhtml页面中,只有合成(它使用模板)。可能是个问题?
  • 仅当您嵌套表单时。其他提示,请查看stackoverflow.com/questions/2118656/…
  • 好的,您的回复我成功解决了这个问题,它是响应 5,我渲染了对话框,然后将值渲染器设置为 null,所以它无法完成安全检查。非常感谢!
  • 不客气。我将其转发为答案。

标签: java jsf primefaces facelets


【解决方案1】:

这可能有许多可能的原因,常见的原因是嵌套&lt;h:form&gt; 组件或在输入或在表单提交期间评估false 的父级之一上使用rendered 属性。有关它们的详细概述,请查看commandButton/commandLink/ajax action/listener method not invoked or input value not updated

【讨论】:

    猜你喜欢
    • 2013-05-01
    • 2020-08-05
    • 2012-07-03
    • 2013-10-19
    • 1970-01-01
    • 2023-03-28
    • 2012-07-10
    相关资源
    最近更新 更多