RichFaces extendedDataTable滚动条在屏幕调整大小之后才会显示

时间:2017-08-29 22:31:13

标签: javascript html css richfaces myfaces

我使用的是richFaces 4.5.17,我试图使用extendedDataTable。当我第一次加载页面时,显示的数据太大,应该会生成一个显示滚动条的扩展数据表。但是,实际结果只是一个窗口,只显示4行。此外,数据表中没有显示标题。

如果你根本调整浏览器窗口的大小,即使是1px,它也会变大或变小,滚动条会突然出现并弹出标题。

虽然有针对用户的解决方法,但每次刷新页面时用户都必须调整窗口大小,这是一个重大缺陷。

标题显示时生成的高度为0,但我可以通过修改styles.css页面来显示标题:

.rf-edt-hdr-c{
    height:45px !important;
}

我页面中的代码片段是:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core" lang="en">
<h:head></h:head>
<h:body>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
    xmlns:t="http://myfaces.apache.org/tomahawk"
    xmlns:rich="http://richfaces.org/rich"
    xmlns:f="http://xmlns.jcp.org/jsf/core"
    xmlns:h="http://xmlns.jcp.org/jsf/html"
    xmlns:a4j="http://richfaces.org/a4j" >

    <t:panelGroup>
        <rich:collapsiblePanel header="Reverts:" headerClass="textLeft" switchType="ajax" >

            <rich:extendedDataTable id="listReverts" value="#{accountingBacking.reverts}" var="revert"  columnClasses="textCenter, textCenter,textRight, textLeft,textCenter, textLeft"
                sortMode="single" first="0" frozenColumns="1" style="width:830px;height:100px;">

                <rich:column sortBy="#{revert.tranDate}">
                    <f:facet name="header">
                        <h:outputText value="Tran Date" />
                    </f:facet>
                    <a4j:commandLink  render="accountDetailForm" action="#{accountingBacking.loadRevertTransaction}" onclick="#{rich:component('popAccountTranDetail')}.show()" onmouseover="Tip('#{msg_bundle.account_loadDetail_help}')">

                        <a4j:param name="tranid" value="#{revert.tranid}" assignTo="#{accountingBacking.tranId}" />                         
                        <h:outputText value="#{revert.tranDate}">
                            <f:convertDateTime type="date" pattern=" MM/dd/yyyy" />
                        </h:outputText>
                    </a4j:commandLink>
                </rich:column>

                <rich:column sortable="false">
                    <f:facet name="header">
                        <h:outputText value="Org" />
                    </f:facet>
                    <h:outputText value="#{revert.org}" />
                </rich:column>
            </rich:extendedDataTable>
        </rich:collapsiblePanel>
    </t:panelGroup>
</ui:composition>
</h:body>
</html>

1 个答案:

答案 0 :(得分:0)

答案最终出现在版本中。

我最终使用4.5.10保留了我的网站功能,同时避免了4.5.17中引入的错误

在RichFaces 4.5.17的最终版本中,存在一个阻止javascript自动动态呈现滚动条的错误。 解决方案是将版本备份到足以让我没有遇到相同的错误,同时避免发布说明中描述的许多其他已知错误 https://developer.jboss.org/people/michpetrov/blog/2016/06/22/richfaces-4517final-release-announcement