PrimeFaces按钮,这是在TabView的
问题描述:
我有鉴于对话框:PrimeFaces按钮,这是在TabView的
<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>
当我点击顶部scrollpanel一个按钮,它做工精细,但是当我向下滚动到滚动并单击它之前我没有看到的按钮时,它会滚动到不发生事件/动作。当我再次滚动到此按钮并再次单击时,它工作正常,但如果我单击其他滚动按钮时我没有看到,我必须再次加倍时间单击此按钮以触发事件/操作。当我通过“source.xhtml”到第一个标签时,它工作正常。为什么它像这样工作?如何改变它正常工作?
我使用JSF 2.2和Primefaces 6.0。
答
解决方案: 将add mode =“native”添加到sec和tab中的scrollPanell中。