You need to sign in to do that
Don't have an account?
Fieldsets in a Datatable
I am trying to use Dynamic Field Binding with in a datatable.
I want to send a List of Tasks from a query to a datatable to be rendered, but be able to add columns to the table using a fieldset defined in Task Field Sets.
Here is my code:
<apex:dataTable cellspacing="2" value="{!Tasks}" var="ta" rendered="{!HasActivities}" id="Results3" rowClasses="odd,even">
<apex:column headerValue=""><apex:outputLink value="/{!ta.Id}" target="_blank">View</apex:outputLink></apex:column>
<apex:column headerValue=""><apex:outputLink value="/{!ta.Id}/e?" target="_blank">Edit</apex:outputLink></apex:column>
<apex:repeat value="{!$ObjectType.Task.FieldSets.TaskMassEditFieldSet}" var="f">
<apex:column headerValue=""><apex:inputField value="{!ta.[f]}" /></apex:column>
</apex:repeat>
</apex:dataTable>
!Tasks is my list of Tasks.
When I try to save the page I get an "Invalid field for SObject Task" Error
Is this possible?
Thanks in advance for any help.
The syntax for the dynamic field reference should be {!ta[f]}, not {!ta.[f]}
All Answers
The syntax for the dynamic field reference should be {!ta[f]}, not {!ta.[f]}
Hi that's not working please once confirm this . actually its getting displayed null
please find the below my controller and Pages
Advance Thanks