I have a commandLink primefaces with an internal graphicImage (JSF 2 with Primefaces 5).
Following code works fine:
<p:commandLink action="#{mybean.mymethod()}" process="@this">
<h:graphicImage name="images/one.jpg"
rendered="#{myBean.test.size() == 0" />
</p:commandLink>
Unfortunately, I have any graphicImage in my application so I would like set image in a css class.
I think about something:
<p:commandLink action="#{mybean.mymethod()}" process="@this">
<h:graphicImage styleClass="myClass"
rendered="#{myBean.test.size() == 0" />
</p:commandLink>
where my css file is following:
.myClass {
background-image: url('/myApplication/resources/images/one.jpg');
}
but doesn't work.
Is it possible? Otherwise, how can I replace graphicImage component? I try with img tag or adding a class in commandLink component with a background-image but doesn't work.
Any idea?
Thanks.