Hide Spawned Content after Showing with bOverlay
Is it possible to hide content that was spawned from a page template using bOverlay?
I'm trying to create a single form that has similar content but will spawn new contend based on selection in a combo box. I'd rather use spawn and page templates as a lot of the background elements will change depending on selection.
Spawning works great, but I'm unsure if it's possible to remove a spawned template contents after spawning it. I could hide the fields but not the background page data. I think replacing bg data also would require advanced usage rights I don't want to mess with.
The other option would be to create background elements as read-only buttons and scrap the spawning idea, but it's not as clean as I'd like it to be. It's my number 1 fallback, however. I'd also rather not mess with the rect property. It annoys me.
Another idea I was toying with is if it were possible to create a template out of page 1 and spawn the template as default, then create a trigger from the combo box (if it's not set at the default selection) it would validate that, then spawn a new copy of page 1 then delete the original page 1.
Here's the code I tried that didn't work. I assume it's trying to hide the template page and not the template overlaid on the page, which is what I'm looking for.
var partsT = this.getTemplate("parts");
var eurgaT = this.getTemplate("eurga");
var repairT = this.getTemplate("repair");
var infieldT = this.getTemplate("in-field");
if(event.willCommit) {
if(event.value == "Parts Request") {
partsT.spawn(0, false, true);
eurgaT.hidden = true;
repairT.hidden = true;
infieldT.hidden = true;
}
else if(event.value == "End User RGA") {
partsT.hidden = true;
eurgaT.spawn(0, false, true);
repairT.hidden = true;
infieldT.hidden = true;
}
else if(event.value == "Repair Request") {
partsT.hidden = true;
eurgaT.hidden = true;
repairT.spawn(0, false, true);
infieldT.hidden = true;
}
else if(event.value == "In-Field Service Request") {
partsT.hidden = true;
eurgaT.hidden = true;
repairT.hidden = true;
infieldT.spawn(0, false, true);
}
else if(event.value == "Select Form") {
partsT.hidden = true;
eurgaT.hidden = true;
repairT.hidden = true;
infieldT.hidden = true;
}
}