This content has been marked as final.
Show 4 replies
-
1. Re: how to show a background image with h:commandButton?
asfak.mahamud Oct 18, 2009 6:33 AM (in response to asfak.mahamud)
Let me add one more point here...... I need a suggestion so that all <h:commandButton s' style can be controlled from one place.......
I do not want to add any css class as attribute of <h:commandButton -
2. Re: how to show a background image with h:commandButton?
ilya_shaikovsky Oct 19, 2009 9:07 AM (in response to asfak.mahamud)read about standard components skinning in developer guide.
-
3. Re: how to show a background image with h:commandButton?
asfak.mahamud Oct 20, 2009 12:22 AM (in response to asfak.mahamud)
Thanks for your reply. I've actually read that but could not figure out what to do.
I have an image button.gif in WebContent/META-INF/button.gif
I have a styles.xcss file in WebContent/META-INF/skins.
My application has an <h:commandButton which is rendered as<input id="registerActionForm:cancel" type="submit" name="registerActionForm:cancel" value="Cancel" />
in the html file.
styles.xcss file has style for this input as<u:selector name="input[type='submit'], input[type='button']"> <u:style name="padding" value="1px 4px"/> <u:style name="background-image"> <f:resource f:key="org.richfaces.renderkit.images.TabGradientB"/> </u:style> <u:style name="border" value="1px solid #FEFEFE"/> <u:style name="outline" value="1px solid"/> <u:style name="outline-color" value="#FF0000"/> <u:style name="color" skin="controlTextColor"/> </u:selector>
My html file gets all the css defined above from the styles.xcss. I've tested this.
Now I want to change the background image from org.richfaces.renderkit.images.TabGradientB to my button.gif
I tried to give the path of the button.gif in the <f:resource f:key=" attribute. But the application throws exceptions saying that it did not find the resources' path
Question: What should I do to see the image button.gif as background image of all of my <h:commandButton? -
4. Re: how to show a background image with h:commandButton?
asfak.mahamud Oct 20, 2009 1:30 AM (in response to asfak.mahamud)It's done, thanks.