【发布时间】:2014-06-05 06:18:00
【问题描述】:
版本:
Apache MyFaces 2.1.14 RichFaces 4.3.5
问题:
我们正在从 jsf 1.2 迁移到 jsf 2。
我提出了一个关于样式表的类似问题here。
问题是相同的样式(根据上述问题中的答案)在另一个 rich:dataTable 组件中没有生效。
最后,内置的 Richfaces 样式表的工作方式如下面的代码所示。
为表头生成的 html 代码也显示在rf-dt-shdr-c(解决问题的内置样式表更改)出现的位置。
所以问题是: 为什么相同的rich:dataTable 组件具有相同的样式生成的html 不同。 在这个 rich:dataTable 中添加的唯一变化是排序行为,如下面的代码所示:
代码:
<!-- rich faces built in style (worked )-->
.rf-dt-shdr-c{
background-image:url(../images/heading-bg.gif) !important;
background-position: left top !important;
background-color: #FFFFFF !important;
white-space:nowrap !important;
}
<!-- header class (not working ) -->
.headerClass1 {
background-image:url(../images/heading.gif);
background-color: #FFFFFF;
background-position:top left;
background-repeat:repeat-x;
}
<!-- rich dataTable with column sorting using a4j:commandLink in header -->
<rich:dataTable value="#{bean.data}" var="val" styleClass="adminTable1" headerClass="headerClass1" rows="#{bean.rowsPerPage}" rowClasses="oddRow,evenRow" render="requests" index="index">
<c:forEach items="#{items}" var="column">
<rich:column sortBy="" sortOrder="">
<f:facet name="header">
<a4j:commandLink/>
</f:facet>
</rich:column>
</c:forEach>
</rich:dataTable>
<!-- html generated for table header part for this question (rf-dt-hdr richDataTableHeader1 is missing here whereas rf-dt-shdr-c comes into play ) -->
<thead class="rf-dt-thd" id="sampleForm:req:th">
<tr class="rf-dt-shdr" id="sampleForm:req:ch">
<th class="rf-dt-shdr-c" id="sampleForm:req:j_id_1d_1_w_1" scope="col">
<!-- html generated for other rich:dataTables , -->
<thead class="rf-dt-thd" id="profForm:app:th">
<tr class="rf-dt-hdr richDataTableHeader1 rf-dt-hdr-fst" id="profForm:app:0">
<th class="rf-dt-hdr-c" id="profForm:app:j_id_67">
【问题讨论】: