I'm facing the exact same issue described here Error: Incorrect parameter type for subscript. Expected Text, received SetValue
I'm trying to populate a table with a list of input fields, where the actual fields are determined at run time, using dynamic vf binding.
I have the following code in my controller extension
public Lead lead {get;set;}
public Set<String> fieldsToPopulate {get; set;}
Then in my page, I'm looping through the set, which contains the API name of some fields in the Lead object
<apex:repeat value="{!fieldsToPopulate}" var="f">
<apex:inputField value="{!Lead[f]}"/>
</apex:repeat>
The above results in the following error when saving the page
Incorrect parameter type for subscript. Expected Text, received SetValue
If I simply print the field name, instead of using an inputField, the field name is displayed correctly.
This follow the pattern described in the official visualforce guide, right here: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_dynamic_vf_sample_standard.htm?search_text=dynamic
Any ideas why this isn't working?