0

This is the name and path of Static Resource (ComplianceImage.Zip) File "ComplianceImages/Yes.png" , "ComplianceImages/No.png" etc..I am unable to display image in column. Pls help

<apex:column headervalue="Image"> 
               <apex:image value ="{!IF(Asq.Obj.Compliance_Status__c=="No", URLFOR($Resource.ComplianceImages,'Yes.Png'),
                                     IF(Asq.Obj.Compliance_Status__c=="Approved", URLFOR($Resource.ComplianceImages,'Yes.Png'),
                                     IF(Asq.Obj.Compliance_Status__c=="Candidate Submission (Requires Verification)", URLFOR($Resource.ComplianceImages,'RV.Png'),
                                     IF(Asq.Obj.Compliance_Status__c=="More Required", URLFOR($Resource.ComplianceImages,'MR.Png'),
                                     IF(Asq.Obj.Compliance_Status__c=="Rejected", URLFOR($Resource.ComplianceImages,'NA.Png'))}" width="20" height="20"/>                 
            </apex:column>
3
  • what is the issue? your code looks good. Can you pls open dev console(or Press F+12) check console any error you are getting?
    – Ratan Paul
    Commented Nov 30, 2015 at 11:35
  • No Error. Image is not being displayed. Displayed as "Broken" file in column of table
    – Praveen
    Commented Nov 30, 2015 at 11:37
  • Pls add screenshot
    – Ratan Paul
    Commented Nov 30, 2015 at 11:38

2 Answers 2

1

This all depends on your zip file hierarchy.

In your local, Open the zip(open, don't extract), if you see your files right after opening the file, your code is fine. If you have to enter one level deep( a folder called ComplianceImages), then you have to add ComplianceImages/Yes.png to your code.

URLFOR($Resource.ComplianceImages,'ComplianceImages/Yes.Png')
2
  • No there are no further folders
    – Praveen
    Commented Nov 30, 2015 at 11:41
  • Can you please add a screenshot of your zip file opened in Winrar or any other utility? Commented Nov 30, 2015 at 11:42
1

I just missed this "blah blah, '/Yes.png') It works now. Thanks.

3
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post. - From Review Commented Nov 30, 2015 at 12:58
  • It does provide an answer to the question. I missed a '/' in the path. So i recognised it by myself. Thats what i specified in previous comment.
    – Praveen
    Commented Dec 1, 2015 at 4:57
  • OK, thanks for clarifying. Just trying to make sure your answer is generic so that others with the same problem can benefit from it as well. :-) Commented Dec 3, 2015 at 9:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .