I have an apex component which displays a list of Albums and Images under each album.
Here is the code for the component
global class AttachmentModel {
public ID Id;
public DateTime CreatedDate;
public String FileName;
public String Description;
public String ParentId;
public String ActualSizeExId;
public String FullSizeExId;
public String ThumbnailExId;
public String FullSizeUrl;
public String ThumbnailUrl;
public Decimal FileSize;
public String FileType;
}
<apex:component >
<apex:attribute name="albums" description="" type="Album__c[]" required="true" />
<apex:attribute name="images" description="" type="map" required="true" />
<apex:pageBlock>
<div class="content-section">
<apex:repeat value="{!albums}" var="album">
<apex:repeat value="{!images[album.id]}" var="image">
<div class="photo-item-container">
<apex:outputField value="{!album.name}"/>
<apex:image value="{!image.ThumbnailUrl}" width="200" height="200" />
<apex:outputText value="{!image.FileName}"/>
<apex:outputText value="{!image.Description}"/>
</div>
</apex:repeat>
</apex:repeat>
</div>
</apex:pageBlock>
</apex:component>
- Attribute 'albums' is pass in as List === a list of Sobject 'Album__c'
- Attribute 'images' is pass in as Map> === a map of 'Album' Id and its Attachment(Image) list. Note that AttachmentModel is a custom model class I created in apex. the Code is posted above.
The problem is that Every time when this component is invoke, system throw error: Unknown Property: ournamespace.AttachmentModel.ThumbnailUrl
It seems like the system can recognize the datamodel type but fail to recognize the properties under it.
Need your help to figure out why.
Thank you!