PrimeFaces button on scrollpanel which is in tabview

我与影子孤独终老i 提交于 2019-12-11 04:29:59

问题


I have view in Dialog:

 <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>

And source:

<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>

When I click a button on top scrollpanel it work fine, but when I scroll down to button which I not see before scroll and click it, It scrolling to up and don't fire event/action. When I again scroll to this button and click again it work fine, but if I click other button which I don't see on before scroll I must again double time click this button to fire event/action. When I past "source.xhtml" to first tab it work normal. Why it work like this? how change it to work normal?

I use JSF 2.2 and Primefaces 6.0.


回答1:


Solution: add mode="native" to scrollPanell in secand tab.



来源:https://stackoverflow.com/questions/42621409/primefaces-button-on-scrollpanel-which-is-in-tabview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!