Just a basic need but cannot get it to work. I would like to have a primefaces button to display my image, without any text.
But what i get is a button that contains only a ^
character and does NOT displaying the image, which only has a size of 16x16.
So, this is the primefaces button :
<p:commandButton image="ui-icon-csv" title="CSV Document" ajax="false">
<p:dataExporter type="csv" target="gridRPBDetails"
fileName="#{tInputBean.exportFilename}" />
</p:commandButton>
This is the css file :
.ui-icon-csv {
background-image: url(images/csv_small.png);
}
And this is the generated html for the button :
<button type="submit" onclick=";"
name="gridRPBDetails:j_idt82" id="gridRPBDetails:j_idt82"
class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary"
role="button" aria-disabled="false">
<span class="ui-button-icon-primary ui-icon ui-icon-csv"></span><span class="ui-button-text">CSV Document</span>
</button>
And to prove the image accessible, i try this URL, and indeed it shows the picture :
http://albert:8080/mywebapp/faces/javax.faces.resource/images/csv_small.png
Im using tomcat 7, and these are my dependencies :
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.0.4-b09</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.0.4-b09</version>
<scope>compile</scope>
</dependency>
Any ideas what went wrong ?
Thank you !