【问题标题】:RichFaces extendedDataTable scrollbars don't show up until after screen resizeRichFaces extendedDataTable 滚动条直到屏幕调整大小后才会显示
【发布时间】:2018-02-07 12:11:31
【问题描述】:

我正在使用richFaces 4.5.17,并且正在尝试使用extendedDataTable。当我第一次加载页面时,显示的数据太大,应该会导致显示滚动条的扩展数据表。但是,实际结果只是一个仅显示 4 行的窗口。此外,数据表中不显示任何标题。

如果您完全调整浏览器窗口的大小,使其变大或变小甚至 1 像素,滚动条会突然出现并且标题会弹出。

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

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

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

我页面中的代码的 sn-p 是:

<?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>

【问题讨论】:

  • collapsiblePanel 折叠了吗?如果表格不可见,则表格无法正确计算标题大小等内容。
  • 默认不折叠。它就像一张普通的桌子一样显示。这就是行为如此奇怪的原因。这就像初始化或更新 js 没有触发

标签: javascript html css richfaces myfaces


【解决方案1】:

答案最终出现在版本中。

我最终使用 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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-02
    • 2023-03-23
    • 2016-05-21
    • 2016-04-20
    相关资源
    最近更新 更多