You need to sign in to do that
Don't have an account?
PipDenno
How do I use the commandbutton attibute IMAGE. I just see a broken image.
When useing the <apex:commandbutton> component how do I use the IMAGE option to show an image of a button I have which is stored in the static resources section of SFDC. The button is called 'Submit_Button_Green'.
I am trying to use something like:
<apex:commandButton image="Submit_Button_Green" action="{!saveNSSEForm}" />
Any help is appretiated.
To fetch ayy static resource your syntax should be
1)If you have directly made image a Static Resource :
<apex:image url="{!$Resource.TestImage}" width="50" height="50" />
2)If you have a zip file as resource and inside it a folder and image in folder
<apex:image url="{!URLFOR($Resource.TestZip, 'images/Bluehills.jpg')}" width="50"height="50" />
Here : TestZip is Zip file as Statiuc Resource
images : is Image folder in zip file
Bluehills.jpg : is the image file
All Answers
To fetch ayy static resource your syntax should be
1)If you have directly made image a Static Resource :
<apex:image url="{!$Resource.TestImage}" width="50" height="50" />
2)If you have a zip file as resource and inside it a folder and image in folder
<apex:image url="{!URLFOR($Resource.TestZip, 'images/Bluehills.jpg')}" width="50"height="50" />
Here : TestZip is Zip file as Statiuc Resource
images : is Image folder in zip file
Bluehills.jpg : is the image file
This works when showing an image but not not seem to be accepted when using within the image attribute of the command button.
<apex:commandbutton image="?????" value="" action="{!submit}" />
I have managed to get it to work. I played around with the format and the following now seems to have worked.
<apex:commandbutton image="{!URLFOR($Resource.Submit_Button_Green)}" ........ />
Thanks for your help.