I've done this on my form. What I did was make subform and then place all the objects I wanted to be hidden and then made visible inside. I then used this code on the button:
if (this.rawValue == "1") {
oTargetField = this.resolveNode("subform name here");
oTargetField.presence = "hidden"
}
if (this.rawValue == "0") {
oTargetField = this.resolveNode("Subform name here");
oTargetField.presence = "visible"