function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
jdogsailingjdogsailing 

Transient Objects to Support Summary Views

I'm trying to build an extension controller that can return a list of arbitrary computed values to a web page. What I really would like to return from the controller method is a list of transient objects that contains the field values to be displayed in the apex:datatable. I don't see a direct way to do this, and while I can imagine faking it with a List<Map<String, String>> I wonder if this is the recommended practice?
jdogsailingjdogsailing

Tried the List<Map<String, String>> hack, and the extension controller method (getMyMethod) compiles. But now the apex:column view doesn't like my {!obj.get('foo')} notation.

 

e.g.

 

            <apex:datatable value="{!MyMethod}" var="obj" styleClass="list">
                <apex:column>
                    <apex:facet name="header">#Foos</apex:facet>
                    <apex:outputText>{!obj.get('foo')}</apex:outputText>
                </apex:column>
 

Error: Unknown function obj.get. Check spelling.