【问题标题】:Cannot change tabs on tabPanel by clicking on the tabs in richfaces 4无法通过单击richfaces 4中的选项卡来更改tabPanel上的选项卡
【发布时间】:2014-01-07 12:12:18
【问题描述】:

我正在使用带有“onheaderclick”属性的tabPanels,如下所示

            <rich:tabPanel id="integrationCenterTabPanel" activeItem="#{integrationCentralOverviewAction.activeTab}" switchType="ajax">
            <a4j:jsFunction name="clearSelections"
                            action="#{integrationCentralOverviewAction.clearSelections}"
                            />

                <rich:tab id="invoiceTab" header="#{messages.invoices}"
                    immediate="true" name="invoiceTab" onheaderclick="clearSelections();">

*************
*************
</rich:tab>
                <rich:tab id="customerTab" header="#{messages.customers}"
                    immediate="true" name="customerTab" onheaderclick="clearSelections();">
***************
**************
</rich:tab>

并且我无法通过单击标题在选项卡之间切换,当我删除 onheaderclick 属性时它工作正常。我在这里做错了什么!

【问题讨论】:

    标签: java jsf richfaces


    【解决方案1】:

    您实际上尝试同时执行两个 Ajax 请求:

    • 通过 ajax 执行 clearSelections
    • 通过ajax加载新标签

    因为ajax是异步处理的,会是这个原因。

    您可以尝试将rich:tabs switchType 更改为switchType="client"orswitchType="server"`(Ajax 将消失)或将 selectionClearing 作为 changeListener 添加到 rich:tabPanel。这可能看起来像例如(未经测试):

    <rich:tabPanel ... 
       itemChangeListener="#{integrationCentralOverviewAction.clearSelections}"/>
    

    希望对你有帮助...

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多