【问题标题】:PrimeFaces button on scrollpanel which is in tabview滚动面板上的 PrimeFaces 按钮,位于 tabview
【发布时间】:2017-07-26 01:46:34
【问题描述】:

我在对话框中有视图:

 <p:scrollPanel style="height: 610px; width: 740px;">
    <p:messages id="messages" showDetail="false" autoUpdate="false" closable="true" />
    <p:tabView id="tabs">
      <p:tab id="header" title="Ogólne">
        <ui:include src="Header.xhtml" />
      </p:tab>
      <p:tab id="source" title="Pomiary" >
        <ui:include src="Source.xhtml" />
      </p:tab>
    </p:tabView>
  </p:scrollPanel>

来源:

<h:panelGroup>
<p:scrollPanel style="height: 530px;">
  <p:panelGrid >
    <p:row>
      <p:column >
            <p:commandButton actionListener="#{huSourcesController.newAF()}" 
                             immediate="true" update="StudyForm-tabs-AFcoll"
                             oncomplete="PrimeFaces.focus('StudyForm-tabs-AFCollReapeat-#{huSourcesController.focusNewAF()}-AFinput');">
              <p:ajax process="StudyForm-tabs-AFcoll" partialSubmit="true" />
            </p:commandButton >
      </p:column>
    </p:row>
     ......
    <p:row>
      <p:column >
            <p:commandButton actionListener="#{huSourcesController.newGM()}" 
                             immediate="true" update="StudyForm-tabs-GMcoll"
                             oncomplete="PrimeFaces.focus('StudyForm-tabs-GMCollReapeat-#{huSourcesController.focusNewGM()}-GMinput');">
              <p:ajax process="StudyForm-tabs-GMcoll" partialSubmit="true" />
            </p:commandButton >
      </p:column>
    </p:row>
  </p:panelGrid> 
</p:scrollPanel>

当我单击顶部滚动面板上的按钮时,它可以正常工作,但是当我向下滚动到滚动之前看不到的按钮并单击它时,它会向上滚动并且不会触发事件/动作。当我再次滚动到此按钮并再次单击时,它可以正常工作,但是如果我单击滚动前看不到的其他按钮,我必须再次双击此按钮以触发事件/动作。当我将“source.xhtml”传递到第一个选项卡时,它工作正常。为什么它会这样工作?如何改变它正常工作?

我使用 JSF 2.2 和 Primefaces 6.0。

【问题讨论】:

    标签: primefaces jsf-2.2 tabview


    【解决方案1】:

    解决方案: 在第二个选项卡中将 mode="native" 添加到 scrollPanel。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-01-06
      • 1970-01-01
      • 2014-11-02
      • 2018-10-02
      • 2012-10-29
      • 2017-04-04
      • 1970-01-01
      相关资源
      最近更新 更多