I suppose that this ultimately can apply to objects as well as pages. At the moment though, I'm really more concerned with pages and subpages.
I want to hide/show multiple pages based on a drop-down menu selection. I have of course searched regarding this subject. Nobody seems to be quite asking for what I'm asking, and the most closely related questions only answer for a single object rather than multiple.
I have a dropdown menu that, depending on the selection, certain pages and subpages which were previously hidden become visible. However, I am trying to build in a certain forgiveness, so that if someone accidentally selects the wrong item on the dropdown menu and goes back to correct themselves, either (1) all of the associated pages will go back to their default state of hidden, before continuing forward and making certain selections visible, or (2) each object is manually named and told to go back to being hidden.
The only way I've found to do this is as follows:
switch (newValue)
{
case "1":
this.resolveNode("subpage_1").presence = "visible";
this.resolveNode("subpage_2").presence = "hidden";
this.resolveNode("page_3").presence = "hidden";
break;
case "2":
this.resolveNode("subpage_1").presence = "hidden";
this.resolveNode("subpage_2").presence = "visible";
this.resolveNode("page_3").presence = "hidden";
break;
case "3":
this.resolveNode("subpage_1").presence = "hidden";
this.resolveNode("subpage_2").presence = "hidden";
this.resolveNode("page_3").presence = "visible";
break;
}
This is tedious, time consuming, and inelegant. What I'd like to do instead is address multiple objects simultaneously. Something like:
switch (newValue)
{
case "1":
this.resolveNode("subpage_2", "page_3").presence = "hidden";
this.resolveNode("sabpage_1").presence = "visible";
break;
case "2":
this.resolveNode("subpage_1", "page_3").presence = "hidden";
this.resolveNode("subpage_2").presence = "visible";
break;
case "3":
this.resolveNode("subpage_1", "subpage_2").presence = "hidden";
this.resolveNode("page_3").presence="visible";
break;
}
I'm aware that this is seen as inelegant in and of itself, but given the overall design of the sheet, the naming scheme, etc, there's really no way to have the system call all pages or subpages starting with the same letters and such. So I'd have to name each one individually. And that's fine! But I've tried a million methods to no avail. I just want a more condense way to hide/make visible multiple pages and subpages simultaneously, or barring that to reset the visibility to the default.