I have an abstract class and a couple of descendants of that class. When I do an apex:repeat over a list of instances of the abstract class I can't access anything defined solely in the child classes except via dynamic VF bindings.

example vf:

<apex:repeat value="{!abstractobjs}" var="obj">
    <apex:outputpanel layout="none" rendered="{!obj.objectType == 'Child1'}">
        <apex:inputField value="{!obj['inputobj'][obj['inputField']]}" /> 
    <apex:outputpanel layout="none" rendered="{!obj.objectType == 'Child2'}">
        <apex:selectList value="{!obj['selected']}" multiselect="false">
                <apex:selectOptions value="{!obj['options']}"/>
    ...repeat for many objecttypes

I could define inputobj, inputfield, etc. in the base abstract class and then simply implement them in the child classes but this makes my classes messier than they need to be.

Are there any performance issues (the repeat will be over 100s of objects) or other drawbacks of using dynamic vf bindings for this?

1 Answer 1


We do lots of dynamic property bindings like this in VF and haven't experienced any drawbacks. I would expect the work being done under the covers to navigate the object graph being pretty much identical for explicitly named properties and dynamic properties.

Your other option would be to create dynamic VF components in your controller, but that always feels like way too much of a violation of MVC to me.

  • As I've mentioned a lot of places as well, with a cloud based platform the chances of the server processing time being the bottleneck in a request are pretty much zero.
    – Matt Lacey
    Commented Feb 20, 2013 at 5:25
  • Not sure what you mean? It's very easy to push server processing time to a significant (1+ second) portion of request time in Apex. Happens all the time to me.
    – jkraybill
    Commented Feb 20, 2013 at 6:24
  • The comment was to provide additional info, not to be in contention with your answer. Sever time can be pushed pretty high but in the majority of cases it's likely to be very small in comparison rest of the request time, though that is heavily dependant on the connection speed of the user of course.
    – Matt Lacey
    Commented Feb 20, 2013 at 6:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .