0
我有一个JSF应用程序,并基于某些数据动态生成<table>
s。 对于每个小区我动态生成的CSS类和我写的* .jsf文件中的所有类(使用ResponseWriter
)在ajax更新上添加CSS类?
一个简化的结果页面:
<div id="styles">
<style type="text/css">
cell1 {
color: red;
}
cell2 {
color: blue;
}
cell3 {
color: black;
}
cell4 {
color: green;
}
</style>
</div>
<table style="width:100%">
<tr>
<td class="cell1">Jill</td>
<td class="cell2">Smith</td>
</tr>
<tr>
<td class="cell3">Eve</td>
<td class="cell4">Jackson</td>
</tr>
</table>
表可以是非常大的,它单元格可以共享相同的样式。
单元格样式可以根据表中的某些用户输入进行更改。我可以更新ajax请求上的单元覆盖UIComponent.visitTree(VisitContext context, VisitCallback callback)
但我不知道是否以及如何添加额外的css类。