<p:commandButton> JSF 2.0 resource image not shown

UI Components for JSF
Post Reply
User avatar
Daedalus
Posts: 164
Joined: 28 Jan 2010, 12:03

11 Jun 2010, 11:24

Hello,

i've noticed that your <p:commandButton> does not display images if the path uses the new JSF 2.0 resources feature. With a normal image path everything is ok.

Here an example:

Code: Select all

   
    <p:commandButton type="image" value="Button1"  image="resources/images/menuBar/Button.Global.Search.Normal.png" /> Works!
    <h:commandButton value="Button2"   image="#{resource['images/path/Button2.png']}" />   Works!
    <p:commandButton type="image" value="Button3"   image="#{resource['images/path/Button3.png']}" />    Does not Work!
PrimeFaces 3.0, Glassfish 3.1.2, Mojarra 2.1.6,

User avatar
Daedalus
Posts: 164
Joined: 28 Jan 2010, 12:03

11 Jun 2010, 12:03

I've noticed that it <p:graphicImage> does also not work with an #{resource} Path. Do you completely not support #{resource} paths?
PrimeFaces 3.0, Glassfish 3.1.2, Mojarra 2.1.6,

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

15 Jun 2010, 13:31

#{resource} adds contextPath automatically just like graphic Image, so feel free to create an issue for p:graphicImage.

The way to add an image to new commandButton(2.0.3) is different, it is done with css background.

gdrparker
Posts: 6
Joined: 29 Jun 2010, 07:11

30 Jun 2010, 08:12

Although the css approach works for static content, this is certainly not a very good option for dynamic code that needs to set the image on the fly.
David Parker
Solution Architect
Fdata Software Inc.
PrimFaces 2.1.RC1 / JSF Mojara 2.0.2

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

30 Jun 2010, 12:24

PrimeFaces now supports provided paths that have #{resource}. You need at least 2.1.RC1 for this.

gdrparker
Posts: 6
Joined: 29 Jun 2010, 07:11

30 Jun 2010, 17:08

Thanks for the rapid response...I'll give it a shot.
David Parker
Solution Architect
Fdata Software Inc.
PrimFaces 2.1.RC1 / JSF Mojara 2.0.2

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 9 guests