修复p:tabView primefaces的宽度和高度

时间:2013-05-11 15:45:52

标签: primefaces tabs scroll height tabview

我有p:tabView

<p:tabView id="monpanel"  >

            <p:tab id="tab1" title="Informations">
                <ui:include src="includes/Informations.xhtml" />
            </p:tab>

            <p:tab id="tab2" title="Prix">
            <ui:include src="includes/Prix.xhtml" />
            </p:tab>

            <p:tab id="tab3" title="Fournisseurs">
            <ui:include src="includes/fournisseurs.xhtml" />
            </p:tab>

            <p:tab id="tab4" title="Stock">
            <ui:include src="includes/stock.xhtml" />
            </p:tab>

        </p:tabView>

我希望将高度和宽度固定到所有标签上,当其中一个标签的宽度因验证而改变时:所有标签的宽度都相同

我也想知道是否可以在p:tabView

中创建滚动条

** * ** * ** * 的** * ** * ** 解决方案: ** * ** * ** * ** * ** * ** * ****

<p:tabView id="monpanel">

            <p:tab id="tab1" title="Informations">
                <p:scrollPanel style="width: 596px;height: 231px;border: none;" mode="native" >
                    <ui:include src="includes/Informations.xhtml" />
                </p:scrollPanel>
            </p:tab>

            <p:tab id="tab2" title="Prix">
                <p:scrollPanel style="width: 596px;height: 231px;border: none;" mode="native" >
                    <ui:include src="includes/Prix.xhtml" />
                </p:scrollPanel>
            </p:tab>

            <p:tab id="tab3" title="Fournisseurs">
            <p:scrollPanel style="width: 596px;height: 231px;border: none;" mode="native" >
                <ui:include src="includes/fournisseurs.xhtml" />
                </p:scrollPanel>
            </p:tab>

            <p:tab id="tab4" title="Stock">
            <p:scrollPanel style="width: 596px;height: 231px;border: none;" mode="native" >
                <ui:include src="includes/stock.xhtml" />
                </p:scrollPanel>
            </p:tab>



        </p:tabView>

1 个答案:

答案 0 :(得分:2)

对于tabview中的滚动面板,您可以将模式指定为“本机”以使其生效。有关示例,请参阅here。关于宽度和高度,请参阅其他question