You need to sign in to do that
Don't have an account?
Sarah Ford
Getters and Setters are never called before ActionMethod (immediate="false")
This should be so simple but I cannot figure out what is wrong at all. I have simplified my controller and visual force page to simple test fields and methds but I still cannot get my getters or setters to execute. My actionMethod is called but these setters and getters which should execute before never do. I am not getting any exception or error messages in my logs
<apex:page controller="dummyController" docType="html-5.0"> <apex:pageBlock > <apex:form id="form"> <apex:input value="{!word}"/> <apex:commandButton action="{!initLineItems}" value="Update"/> </apex:form> </apex:pageBlock> </apex:page>
public class dummyController { public String word {get;set;} public void setWord(String s){ System.debug('in the set for word'); word = s; } public String getWord(){ System.debug('in the get for word'); return word; } public PageReference initLineItems(){ System.debug('ACTION METHOD CALLED'); return null; } }
The setter/getter methods are invoked, when the member variable is made private and {get;set;} is removed from its definition. Hope this helps.