Primefaces,带selectManyCheckbox的滚动面板
如何使用带有复选框的p:scrollpanel,我已经尝试过这样做,但没有成功:Primefaces,带selectManyCheckbox的滚动面板,checkbox,primefaces,scroll,Checkbox,Primefaces,Scroll,如何使用带有复选框的p:scrollpanel,我已经尝试过这样做,但没有成功: <p:scrollPanel mode="native" > <h:panelGrid> <p:selectManyCheckbox value="#{localCobrancaBean.selectLocaisCobranca}"> <f:s
<p:scrollPanel mode="native" >
<h:panelGrid>
<p:selectManyCheckbox value="#{localCobrancaBean.selectLocaisCobranca}">
<f:selectItems value="#{localCobrancaBean.listaLocalCobranca}" />
</p:selectManyCheckbox>
</h:panelGrid>
</p:scrollPanel>
我使用以下JSF进行了测试:
<p:scrollPanel mode="native">
<h:panelGrid>
<p:selectManyCheckbox>
<f:selectItem itemLabel="asdfghgfd" />
<f:selectItem itemLabel="zdvdfbdfvds" />
<f:selectItem itemLabel="zdcdghnfw" />
<f:selectItem itemLabel="sddfvdfv" />
</p:selectManyCheckbox>
</h:panelGrid>
</p:scrollPanel>
结果是:
因此,它似乎正在工作。在我看来,解决方案似乎是将scrollpanel模式设置为native。问题在于scrollpanel和selectmanycheckbox DOM的相对和绝对位置。在我的应用程序中,我使用了以下代码集来获取scrollbar的多个复选框列表:
<style type="text/css">
#productCategoryId label {
float: inherit;
font-size: 10px!important;
font-weight: normal;
}
#productCategoryId table.formTable th, table.formTable td {
padding: 0px 0px 0 0;
}
</style>
<div style="width:200px;height: 280px;overflow-y:scroll;overflow-x:hidden;border:1px solid #999;" max-height=280px>
<h:selectManyCheckbox id="productCategoryId" layout="pageDirection" style="width:200px" styleClass="changeId">
<f:selectItem itemValue="-1000" itemLabel="ALL" />
<f:selectItems value="#{lookup.list['RSM_LOOKUP']['PRODUCT_CATEGORY']}"/>
</h:selectManyCheckbox >
</div>
#productCategoryId标签{
浮动:继承;
字体大小:10px!重要;
字体大小:正常;
}
#productCategoryId table.formTable th、table.formTable td{
填充:0px 0px 0;
}