p:commandButton image not displayed

UI Components for JSF
Post Reply
frweisma
Posts: 1
Joined: 31 May 2010, 21:26

21 Jul 2010, 02:59

Hello i hace a problem with the p:commandButton in RC2.1
I was trying to display an icon for the button in the same way
as i see it in the example.

My xhtml page is this:

Code: Select all

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

    <f:view>
        <h:head>
            <title>Facelet Title</title>
            <style type="text/css">
                .deleteIcon {
                    background: url(#{request.contextPath}/images/delete.png) no-repeat;
                }

            </style>

        </h:head>

        <h:body>

            <h:form>
                <p:graphicImage value="/images/delete.png" />
                <p:commandButton value="test" image="deleteIcon" title="" >
                </p:commandButton>
                <h:button styleClass="deleteIcon" />
            </h:form>
        </h:body>
    </f:view>
</html>
The p:graphicImage and the h:button show the image, the p:commandButton not.

Can anybody help ?

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

21 Jul 2010, 16:01

You don't need #{request.contextPath} as css references images relative to the path.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Google [Bot] and 51 guests