I have a very simple page
<apex:page controller="myController1" >
<c:compo value="hello"></c:compo>
</apex:page>
with an empty controller
public with sharing class myController1 {
}
Component compo is
<apex:component controller="compocontroller">
<apex:attribute name="value" type="string" description="tu" assignTo="{!valueclassvar}"/>
</apex:component>
Its controller is
public class compocontroller
{
public string valueclassvar{
get{
system.debug('getmethodvalueclassvar');
return valueclassvar;
}
set{
system.debug('setmethodvalueclassvar');
}
}
}
When i check the debug log i can see setter gets executed twice.does anyone know why. I know the reason why its executed first(because of assignto attribute in component..but why its getting executed for second time..anyone any clue?
Debug log is
30.0 APEX_CODE,DEBUG;APEX_PROFILING,INFO;CALLOUT,INFO;DB,INFO;SYSTEM,DEBUG;VALIDATION,INFO;VISUALFORCE,INFO;WORKFLOW,INFO
04:11:17.018 (18766000)|EXECUTION_STARTED
04:11:17.018 (18807000)|CODE_UNIT_STARTED|[EXTERNAL]|066i0000004EBS1|VF: /apex/orderofexe
04:11:17.034 (34126000)|CODE_UNIT_STARTED|[EXTERNAL]|01pi0000005trqA|compocontroller <init>
04:11:17.034 (34148000)|SYSTEM_MODE_ENTER|true
04:11:17.034 (34726000)|METHOD_ENTRY|[1]|01pi0000005trqA|compocontroller.compocontroller()
04:11:17.034 (34740000)|METHOD_EXIT|[1]|compocontroller
04:11:17.034 (34815000)|CODE_UNIT_FINISHED|compocontroller <init>
04:11:17.034 (34952000)|CODE_UNIT_STARTED|[EXTERNAL]|compocontroller set(valueclassvar,hello)
04:11:17.034 (34962000)|SYSTEM_MODE_ENTER|true
04:11:17.034 (34972000)|CODE_UNIT_STARTED|[EXTERNAL]|compocontroller set(valueclassvar,hello)
04:11:17.035 (35103000)|SYSTEM_METHOD_ENTRY|[10]|System.debug(ANY)
04:11:17.035 (35145000)|USER_DEBUG|[10]|DEBUG|setmethodvalueclassvar
04:11:17.035 (35154000)|SYSTEM_METHOD_EXIT|[10]|System.debug(ANY)
04:11:17.035 (35168000)|CODE_UNIT_FINISHED|compocontroller set(valueclassvar,hello)
04:11:17.035 (35177000)|CODE_UNIT_FINISHED|compocontroller set(valueclassvar,hello)
04:11:17.038 (38362000)|CODE_UNIT_STARTED|[EXTERNAL]|01pi0000005tsxw|myController1 <init>
04:11:17.038 (38382000)|SYSTEM_MODE_ENTER|true
04:11:17.038 (38425000)|METHOD_ENTRY|[1]|01pi0000005tsxw|myController1.myController1()
04:11:17.038 (38437000)|SYSTEM_MODE_ENTER|false
04:11:17.038 (38444000)|SYSTEM_MODE_EXIT|false
04:11:17.038 (38452000)|METHOD_EXIT|[1]|myController1
04:11:17.038 (38471000)|SYSTEM_MODE_ENTER|false
04:11:17.038 (38483000)|SYSTEM_MODE_EXIT|false
04:11:17.038 (38488000)|SYSTEM_MODE_ENTER|false
04:11:17.038 (38491000)|SYSTEM_MODE_EXIT|false
04:11:17.038 (38501000)|CODE_UNIT_FINISHED|myController1 <init>
04:11:17.062 (62475000)|CODE_UNIT_STARTED|[EXTERNAL]|compocontroller set(valueclassvar,hello)
04:11:17.062 (62498000)|SYSTEM_MODE_ENTER|true
04:11:17.062 (62520000)|CODE_UNIT_STARTED|[EXTERNAL]|compocontroller set(valueclassvar,hello)
04:11:17.062 (62622000)|SYSTEM_METHOD_ENTRY|[10]|System.debug(ANY)
04:11:17.062 (62635000)|USER_DEBUG|[10]|DEBUG|setmethodvalueclassvar
04:11:17.062 (62643000)|SYSTEM_METHOD_EXIT|[10]|System.debug(ANY)
04:11:17.062 (62659000)|CODE_UNIT_FINISHED|compocontroller set(valueclassvar,hello)
04:11:17.062 (62671000)|CODE_UNIT_FINISHED|compocontroller set(valueclassvar,hello)
04:11:17.342 (66472000)|CUMULATIVE_LIMIT_USAGE