0

I'm trying to get a JSP web page running with OpenFaces but when I run my page, I don't get the same look and feel as the OpenFaces demo page. It's as if the OpenFaces css is not loading. Is there something special I need to do other than add the library to my project and use sample code as below:

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>

JBehrendt
  • 117
  • 1
  • 2
  • 10

1 Answers1

1

When you declare the DataTable in this way without specifying any of the styling-related attributes, you get the default look&feel for the component (similar to the one in this demo).

There's no support for changing the skin for the entire component, but instead of this, components have a lot of styling attributes. The table on the first DataTable demo page is customized using the component's attributes (see the source code for this demo).

Dmitry Pikhulya
  • 446
  • 2
  • 6