我试图获得一个使用OpenFaces运行的JSP页面,但是当我运行我的页面时,我的外观和感觉与OpenFaces演示页面不同。就好像OpenFaces css没有加载一样。除了将库添加到我的项目中并使用示例代码之外,还有什么特别的事情需要做,如下所示:
index.xhtml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:o="http://openfaces.org/">
<h:head>
</h:head>
<h:body>
<h:form>
<o:dataTable styleClass="dataTable" value="#{personController.personList}" var="person">
<o:column>
<f:facet name="header">Name</f:facet>
<h:outputText value="#{person.name}"/>
</o:column>
<o:column>
<f:facet name="header">Number</f:facet>
<h:outputText value="#{person.no}"/>
</o:column>
<o:column>
<f:facet name="header">Address</f:facet>
<h:outputText value="#{person.address}"/>
</o:column>
</o:dataTable>
</h:form>
</h:body>
发布于 2012-08-28 18:33:02
当您以这种方式声明DataTable而不指定任何与样式相关的属性时,您将得到组件的默认外观和感觉(类似于这个演示中的外观)。
不支持更改整个组件的外观,但是组件有很多样式属性,而不是这个。第一次DataTable演示页面上的表是使用组件的属性进行定制的(有关此演示,请参见源代码 )。
https://stackoverflow.com/questions/12020755
复制相似问题