Skinning not working

UI Components for JSF
User avatar
Crystal
Posts: 18
Joined: 20 Jul 2010, 22:38
Location: CT. USA

21 Jul 2010, 23:02

Hi.
I cannot get skinning to work at all. I had read all through this forum and have tried every suggestion that was made in other threads and it would not work. The only skin I ended up getting to work was Sam.

Here is my web.xml (Before I put Sam in there it was none

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<context-param>
<param-name>primefaces.skin</param-name>
<param-value>sam</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>Resource Servlet</servlet-name>
<servlet-class>org.primefaces.resource.ResourceServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Resource Servlet</servlet-name>
<url-pattern>/primefaces_resource/*</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>faces/index.xhtml</welcome-file>
</welcome-file-list>
</web-app>

Template

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<f:view xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">

<!-- Enables CTRL+SHIFT+D for activating Facelets debug window -->
<ui:debug/>

<html>
<h:head>
<!--<link href="resources/css/candy.css" rel="stylesheet" type="text/css" />-->
<link type="text/css" rel="stylesheet" href="/resources/skin/flick/skin.css"/>
<ui:insert name="htmlHead" />
<!--<h:outputStylesheet library="css" name="resources/skin/flick/skin.css"/>-->

</h:head>
<h:body>
<link type="text/css" rel="stylesheet" href="/resources/skin/flick/skin.css"/>
<h:panelGroup layout="block" styleClass="h3">
<ui:include src="/sections/header.xhtml"/>
</h:panelGroup>
<h:panelGroup layout="block">
<h:form>
<ui:include src="/sections/menu.xhtml"/>
</h:form>
</h:panelGroup>
<h:panelGrid columns="1" columnClasses="nav-col, main-col" styleClass="h1">
<h:panelGroup layout="block">
<ui:insert name="content" />
</h:panelGroup>
</h:panelGrid>
<h:panelGroup layout="block" styleClass="h2">
<ui:include src="/sections/footer.xhtml"/>
</h:panelGroup>
<!--<h:outputStylesheet library="css" name="resources/skin/flick/skin.css"/>-->
<!-- <link type="text/css" rel="stylesheet" href="/resources/skin/flick/skin.css"/>-->
</h:body>

<!-- <h:outputStylesheet library="css" name="resources/skin/flick/skin.css"/>-->
</html>
</f:view>


Menu

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.prime.com.tr/ui">
<!--<h:form>
<p:commandButton value="getCandy" action="getCandy" />
</h:form>-->


<h:form id="form">
<p:growl id="messages"/>

<p:menubar autoSubmenuDisplay="true">
<p:submenu label="CANDY">
<p:menuitem value="Create Candy" action="getCandy"></p:menuitem>
<p:menuitem value="Edit Candy" action="getCandy"></p:menuitem>
<p:menuitem value="Get Candy" action="getCandy"></p:menuitem>
<p:menuitem value="Candy Lookup" action="getCandy"></p:menuitem>
</p:submenu>

<p:submenu label="Configuration">
<p:menuitem value="Global Settings / Preferences Page" action="getCandy"></p:menuitem>
</p:submenu>

<p:submenu label="Dashboard">
<p:menuitem value="Back to Dashboard" action="getCandy"></p:menuitem>
</p:submenu>
</p:menubar>

</h:form>
</ui:composition>


I'm ok using Sam right now but I just wanted to bring this up and see if it's a known issue or if I configured something wrong. It would be cool for me to have the option to use another skin.

Thanks!
Using primefaces-2.1.RC1.jar, Mojarra JSF 2.0.3, GlassFish 3

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

21 Jul 2010, 23:03

Hi,

Welcome to PrimeFaces!

You need to disable default sam skin by;

Code: Select all

<context-param>
<param-name>primefaces.skin</param-name>
<param-value>none</param-value>
</context-param>

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

21 Jul 2010, 23:04

You can find more information at;

http://www.primefaces.org/themes.html

or User's Guide Skinning section;

http://www.primefaces.org/documentation.html

User avatar
Crystal
Posts: 18
Joined: 20 Jul 2010, 22:38
Location: CT. USA

21 Jul 2010, 23:05

Sorry if I wasn't clear. I had it set to none up until the point where I gave up getting skinning to work. Then I made it Sam.
Sorry for misleading code.
Using primefaces-2.1.RC1.jar, Mojarra JSF 2.0.3, GlassFish 3

User avatar
Crystal
Posts: 18
Joined: 20 Jul 2010, 22:38
Location: CT. USA

21 Jul 2010, 23:08

Thanks for the reply but I already read all of the documentation regarding skinning at both of these links.
http://www.primefaces.org/themes.html
http://www.primefaces.org/documentation.html
Using primefaces-2.1.RC1.jar, Mojarra JSF 2.0.3, GlassFish 3

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

21 Jul 2010, 23:47

You might want to add context path when adding your skin css;

<link type="text/css" rel="stylesheet" href="#{request.contextPath}/resources/skin/flick/skin.css"/>

Can you check if your skin.css is loaded properly.

User avatar
Crystal
Posts: 18
Joined: 20 Jul 2010, 22:38
Location: CT. USA

21 Jul 2010, 23:56

That fixed it. Thanks!!

:mrgreen:
Using primefaces-2.1.RC1.jar, Mojarra JSF 2.0.3, GlassFish 3

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

22 Jul 2010, 00:53

Enjoy the themes ;)

jeronimocarrizo
Posts: 23
Joined: 22 Jul 2010, 22:19
Location: Argentina - Buenos Aires - Escobar - Ing. Maschwitz

23 Jul 2010, 15:14

Hello! sking'm trying to use the "ui" lightness ", but I can not make it work.

MyApp.xhtml:

---------------------------------------------------------------------------
<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:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.prime.com.tr/ui">

<f:view contentType="text/html">
<h:head>
<title>My App</title>
<h:outputStylesheet type="text/css" rel="stylesheet" href="css/skin.css" />
</h:head>
<h:body>
.....

</h:body>
</f:view>
</html>

I Use JSF2.0 have the primefaces version: "primefaces-2.1.RC1"
My SO: Windows 7 Enterprise
Y try put absolute path in href="d:/developer/myapp/web/src/main/webapp/css/ui-lightness/skin.css" still not working.
Y use Maven.

Anyone have any idea that still does not implement the theme?
Thank Very Much!!

Jero.

-------------------------------------------
Primefaces-2.1 - GlassFish Server 3.0.1 - Windows 7 Enterprise - Maven

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

23 Jul 2010, 15:19

Try;

Code: Select all

<link type="text/css" rel="stylesheet" href="#{request.contextPath}/css/ui-lightness/skin.css">

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 60 guests