【问题标题】:a4j:commandButton doesn't render the elementa4j:commandButton 不渲染元素
【发布时间】:2014-12-12 12:18:18
【问题描述】:

我有一个带有 <rich:tabPanel> 的 JSF 页面,其中包含 4 个选项卡。

在第 4 个选项卡上,我尝试使用 <a4j:commandButton> 执行操作并渲染 resulTable

这是一个简短的例子

<rich:tab header="Journal">

    <h:form id="filterForm">
        <a4j:jsFunction name="submitByEnter"
                        action="#{smsLogList.refresh}" render="smsTable" />
        <s:div id="divSearch">
            <rich:collapsiblePanel header="#{messages['search']}"
                                   switchType="client">
                <h:panelGrid column="1">
                    <s:decorate template="/layout/edit.xhtml">
                        <ui:define name="label">Package number</ui:define>
                        <h:inputText id="packNum" style="width:200px"
                                     value="#{smsLogList.packNum}">
                            <a4j:ajax event="keyup" listener="#{smsLogList.refresh}"
                                      ignoreDupResponses="true" requestDelay="1500"
                                      render="smsTable" />
                        </h:inputText>
                    </s:decorate>

                    <!---some other search elements-->

                    <s:div styleClass="actionButtons">
                        <a4j:commandButton id="search" value="#{messages['search']}"
                                           render="smsTable" action="#{smsLogList.go}" />
                        <a4j:commandButton id="reset" value="#{messages['clear']}"
                                           onclick="document.getElementById('filterForm').reset();"
                                           action="#{smsLogList.clear}" render="divSearch,smsTable" />
                    </s:div>
                </h:panelGrid>
            </rich:collapsiblePanel>
        </s:div>

        <!--- results table-->

        <h:panelGrid id="smsTable">
            <s:div>
                <rich:dataTable value="#{smsLogList.resultList}" var="sms"
                                id="table" rendered="#{not empty smsLogList.resultList}">
                    <rich:column>
                        <f:facet name="header">Type</f:facet>
                        <h:outputText value="#{sms.smsType}" />
                    </rich:column>

                    <!---- some other columns-->

                </rich:dataTable>
                <rich:dataScroller for="table" />
            </s:div>
        </h:panelGrid>
    </h:form>
</rich:tab>

所以,当我点击&lt;a4j:commandButton&gt; 时 - 没有任何反应,但如果我切换到另一个选项卡并返回 - 结果是必要的。 我尝试将a4j更改为&lt;h:commandButton&gt;,但按下后页面切换到第一个选项卡。

有没有办法解决这个问题?

【问题讨论】:

    标签: jsf richfaces ajax4jsf commandbutton


    【解决方案1】:

    解决方案非常简单。 我在其他&lt;h:form&gt; 中使用了&lt;h:form&gt;。无论如何它都行不通。当我删除 internal 时 - jsf 工作顺利并且应该如此。

    【讨论】:

      猜你喜欢
      • 2012-04-09
      • 2011-05-15
      • 2018-08-07
      • 2017-05-04
      • 1970-01-01
      • 2019-12-19
      • 1970-01-01
      • 1970-01-01
      • 2019-02-26
      相关资源
      最近更新 更多