【问题标题】:a4j:commandButton not working if not rendered on pageloada4j:commandButton 如果未在页面加载时呈现,则不起作用
【发布时间】:2011-03-11 03:31:39
【问题描述】:

如果页面加载时没有呈现,我的 a4j:commandButton 不起作用。 请尝试以下操作:

  <h:form>
    <h:selectBooleanCheckbox value="#{showpnl}">
        <a4j:support event="onclick" reRender="pnl" />
    </h:selectBooleanCheckbox>

    <a4j:outputPanel id="pnl">
        <a4j:outputPanel rendered="#{showpnl}">
            <h:inputText value="#{text}" />
            <a4j:commandButton value="Go" reRender="out" />
        </a4j:outputPanel>
    </a4j:outputPanel>

    <h:outputText id="out" value="Text: #{text}" />
</h:form>

如果你在第 7 行设置:&lt;a4j:outputPanel rendered="true"&gt; 就可以了!!!为什么?

【问题讨论】:

    标签: richfaces


    【解决方案1】:

    确保单击按钮时 #{showpnl} 的计算结果为“真”。否则,按钮将不会被处理。

    【讨论】:

      猜你喜欢
      • 2019-12-27
      • 2011-06-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-08-11
      • 2012-06-05
      • 2013-06-20
      • 1970-01-01
      相关资源
      最近更新 更多