I'm trying to display values of a List<Map<String, Object>> in a Visualforce page by using apex:pageBlockTable.
I'm stuck on what to put in apex:outputField value like below.
Is there any way that this can be made to work? The number of Map<String, Object> is variable.
apex:
String theJsonString = '[{"id":1, "name":"Abc_SS", "description":"Abc", "address":"Abc"}, {"id":2, "name":"sales", "description":"sales", "address":"Abc"}]';
Object theJsonObject = JSON.deserializeUntyped(theJsonString);
List<Object> theJsonList = (List<Object>) theJsonObject;
List<Map<String, Object>> theJsonMapList = new List<Map<String, Object>>();
for (Object obj : theJsonList) {
theJsonMapList.add((Map<String, Object>) obj);
}
visualforce page:
<apex:pageBlockTable value = "{!theJsonMapList}" var="al">
<apex:column headerValue="id">
<apex:outputField value=??>
</apex:column>
<apex:column headerValue="name">
<apex:outputField value=??>
</apex:column>
<apex:column headerValue="discription">
<apex:outputField value=??>
</apex:column>
<apex:column headerValue="address">
<apex:outputField value=??>
</apex:column>
</apex:pageBlockTable>
