You need to sign in to do that
Don't have an account?
Engine Force
Why side-effect in setter method?
In the example here http://www.salesforce.com/us/developer/docs/pages/Content/pages_controller_lifecycle_example.htm?SearchType=Stem&Highlight=Setter|setter|setters, can someone explain why selectedValue = value; is a side-effect? Why cannot you set selectedValue in its own setter method?
public class componentController {
public String selectedValue {
get;
set {
editMode = (value != null);
// Side effect here - don't do this!
selectedValue = value;
}
}
public Boolean editMode {get; private set;}
}
I believe I just mentioned this in our last post, but the code doesn't have the "side-effect" that the article claims to divine to its audience. Just ignore this article (or even better, file a complaint on the page), and work with the information I've provided in my prior post.
All Answers
I believe I just mentioned this in our last post, but the code doesn't have the "side-effect" that the article claims to divine to its audience. Just ignore this article (or even better, file a complaint on the page), and work with the information I've provided in my prior post.