【问题标题】:Ajax with multiple forms具有多种形式的 Ajax
【发布时间】:2015-11-27 18:37:44
【问题描述】:

我有一个包含多个表单的页面。

其中一种形式

    <h:form id="form1">
        <!-- ... -->
        <h:commandButton value="Form button1">
        <f:ajax execute="@form" render="@all" />
        </h:commandButton>
    </h:form>
    <!-- ... -->
    <h:form id="form2">
        <!-- ... -->
        <h:commandButton value="Form button2" />
    </h:form>

    <h:form id="form3">
        <!-- ... -->
        <h:commandButton value="Form button3" />
    </h:form>

当我在 form1 中提交按钮时,form2 中的按钮不会刷新。旧状态仍然保留

我们使用的是 Mojarra 2.2.8 版本

我想知道是否有任何解决方法。

【问题讨论】:

    标签: jsf jsf-2 jsf-2.2


    【解决方案1】:

    尝试指定您要在其中呈现的确切内容。

    例如

    <h:form id="form1">
        <!-- ... -->
        <h:commandButton value="Form button1">
        <f:ajax execute="@form" render=":form2 :form3" />
        </h:commandButton>
    </h:form>
    

    希望对你有帮助

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-07-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多