JSF-2.0, Mojarra 2.1.19, PrimeFaces 3.4.1
I know that we can add an image to button through defining our own css class like:
.imageButton {
background-image:url(#{resource['images/button.png']});
}
But the problem is, picture url is coming from the bean and it has different value for each user, so giving static image url is not going to work. I need sth. like that:
<p:button value="#{loginBean.loggeduser.name}" icon="#{loginBean.loggeduser.picurl}"/>
But as expected this is not working because of the icon property expects a class name. Also I've tried to define a p:graphicImage
component inside the button but doesn't seem like a regular icon.
It should seem like this:
Upper picture can be done with pre-defined icons with below code:
<p:commandButton value="sth" icon="ui-icon-star"/>
But as I said, I don't want to use a static icon.
Thanks in advance.