Please have a look at these 2 code snippets:
(1)
<apex:page id="pageId" standardcontroller="My_Object__c">
<apex:form id="formId">
<apex:pageblock id="pbId">
<apex:pageblocksection columns="1" id="pbsIs">
<apex:repeat value="{!$ObjectType.My_Object__c.FieldSets.MyFieldSet}" var="f">
<apex:inputfield value="{!My_Object__c[f]}">
</apex:inputfield></apex:repeat>
</apex:pageblocksection>
</apex:pageblock>
</apex:form>
</apex:page>
(2)
<apex:pageBlockSection title="Dimensions">
<apex:repeat value="{!fields}" var="f">
<apex:inputField value="{!merch[f.fieldPath]}" required="
{!OR(f.required, f.dbrequired)}"/>
</apex:repeat>
</apex:pageBlockSection>
I have following doubts about it:
- In (1)
<apex:repeat var="f"
is an object that is holding reference of current object
then what is the meaning of writingvalue="{!My_Object__c[f]}"
? what will
!My_Object__c[f]
return? - In (2) what is the meaning of
"{!merch[f.fieldPath]}"
statement?
I would be very grateful if someone can explain better how this fieldset works in salesforce.