• Brian Dombrowski 10
  • NEWBIE
  • 5 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 4
    Replies
This can be done easily using javascript, so am wondering if it's possible with VisualForce.

Here is what I'm trying to do, but doesn't work:
<apex:repeat value="{!account.AttachedContentDocuments}" var="att">
    <apex:outputPanel rendered="{!att.FileType IN ['JPG', 'PNG']}" layout="none">
        <apex:variable var="attachmentCount" value="{!attachmentCount + 1}"/>
    </apex:outputPanel>
</apex:repeat>

One idea is to concat the string array into a string and then use CONTAINS, but that is a little sloppy because there could be false positives.

Concat idea: https://salesforce.stackexchange.com/questions/70094/checking-a-list-if-a-certain-string-exist-in-visualforce-page/70098#70098
 
This can be done easily using javascript, so am wondering if it's possible with VisualForce.

Here is what I'm trying to do, but doesn't work:
<apex:repeat value="{!account.AttachedContentDocuments}" var="att">
    <apex:outputPanel rendered="{!att.FileType IN ['JPG', 'PNG']}" layout="none">
        <apex:variable var="attachmentCount" value="{!attachmentCount + 1}"/>
    </apex:outputPanel>
</apex:repeat>

One idea is to concat the string array into a string and then use CONTAINS, but that is a little sloppy because there could be false positives.

Concat idea: https://salesforce.stackexchange.com/questions/70094/checking-a-list-if-a-certain-string-exist-in-visualforce-page/70098#70098
 
I think my syntax is correct, but attachments are empty even for Accounts with attachments.
 
<apex:page StandardController="Account" readOnly="true" recordSetVar="Accounts" showHeader="false" sidebar="false" cache="false">
    
    <apex:variable var="forceDomain" value="http://districtbridges.force.com" />
    
    <apex:repeat value="{!Accounts}" var="account" rows="1">
        <h3>Account: {!account.name}</h3><br />
        Attachments:<br />
        <apex:repeat value="{!account.Attachments}" var="att">
            - {!att.id} {!att.name}<br />
        </apex:repeat>
        EndAttachments<br />
    </apex:repeat>
</apex:page>