extendedDataTable - height doesn't work

自闭症网瘾萝莉.ら 提交于 2019-12-12 11:04:55

问题


So, like the title says in my case height of the extendedDataTable doesn't work, so my table also doesn't scroll because all rows are shown. I'm using richfaces4.0-final version. So here is my piece of code:

        <rich:extendedDataTable
            value="#{advancedSearchView.criteria}" var="criteria"
            height="50px"
            selection="#{advancedSearchView.selection}" id="table"
            selectionMode="single">
            <rich:column id="criteria_row" filterBy="#{criteria}" filterEvent="onkeyup" width="500px">
                <h:outputText value="#{criteria}" />
            </rich:column>
        </rich:extendedDataTable>

AdvancedSearchView is request scoped bean, and criteria is an array of Strings.

I hope that is enough information. Thank you in advance. A would really appreciate if someone gives me an answer, because I'm struggling with this for a while.


回答1:


According to the RichFaces 4 VDL (View Declaration Language) documentation, the <rich:extendedDataTable> component does not support the height attribute at all.

Your functional requirement is however understood. You want to render the extended datatable with a height of 50px and make the table body scrollable. You need to achieve this using the usual CSS means by style attribute which can take inline CSS declarations, or by the styleClass attribute which can take CSS classes, like as on almost every other JSF HTML component.

So, with style

<rich:extendedDataTable ... style="height: 50px;">

or, with styleClass (which is also the more recommend practice; separate style from markup)

<rich:extendedDataTable ... styleClass="criteria">

and this piece in a CSS file which you include by <h:outputStylesheet />:

.criteria {
    height: 50px;
}


来源:https://stackoverflow.com/questions/8204417/extendeddatatable-height-doesnt-work

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