i have a json string
{
"kind": "storage#objects",
"items": [
{
"name" : "image.png",
"id": "id_1",
"mediaLink": "link",
"contentType": "image/jpg"
},
{
"name" : "image.png",
"id": "id_1",
"mediaLink": "link",
"contentType": "image/jpg"
}
]
}
I have a class in apex
public class JsonGCloudApiApex {
public class Item{
public string name;
public string id;
public string mediaLink;
public string contentType;
}
public List<Item> items;
public static JsonGCloudApiApex parse(String json) {
return (JsonGCloudApiApex) System.JSON.deserialize(json, JsonGCloudApiApex.class);
}}
i have in controller class
public List<JsonGCloudApiApex.Item> listItems {get; private set;}
...
objItems = parse(resp.getBody());
listItems = objItems.items;
This work very good, and i can see on logs the values are setting from model class. I need to create a apex:repeat for list variable: listItems (from controller variable name )
I try to use
<apex:repeat value="{!listItems}" var="item">
<tr>
<td class="withborder" style="width: 40%;">{!item.contentType}</td>
</tr>
</apex:repeat>
But i get the error message: Unknown property 'JsonGCloudApiApex.Item.contentType', on the model class the variable name (contentType) is declared and public How to create a list view on with apex:repeat to print key's values from list on controller?