Copy link to clipboard
Copied
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;
}
}
I got it to work with the idea I had to create a temlate of page 0, spawn it to 1, then hide the original. I then created a keystroke script to check whether the default combo selection was triggered (combo set to select immediately) then spawn page 0 and overlay a template on top of that depending on selection, then delete page 1.
var coverT = this.getTemplate ("cover");
var partsT = this.getTemplate("parts");
var eurgaT = this.getTemplate("eurga");
var repairT = this.getTemplate("repair");
var
...
Copy link to clipboard
Copied
I got it to work with the idea I had to create a temlate of page 0, spawn it to 1, then hide the original. I then created a keystroke script to check whether the default combo selection was triggered (combo set to select immediately) then spawn page 0 and overlay a template on top of that depending on selection, then delete page 1.
var coverT = this.getTemplate ("cover");
var partsT = this.getTemplate("parts");
var eurgaT = this.getTemplate("eurga");
var repairT = this.getTemplate("repair");
var infieldT = this.getTemplate("in-field");
if(event.value != "Select Form") {
if(event.willCommit) {
if(event.value == "Parts Request") {
coverT.spawn(0, false, false);
partsT.spawn(0, false, true);
this.deletePages(1);
}
else if(event.value == "End User RGA") {
coverT.spawn(0, false, false);
eurgaT.spawn(0, false, true);
this.deletePages(1);
}
else if(event.value == "Repair Request") {
coverT.spawn(0, false, false);
repairT.spawn(0, false, true);
this.deletePages(1);
}
else if(event.value == "In-Field Service Request") {
coverT.spawn(0, false, false);
infieldT.spawn(0, false, true);
this.deletePages(1);
}
}
}
else {
if(event.willCommit) {
if(event.value == "Parts Request") {
partsT.spawn(0, false, true);
}
else if(event.value == "End User RGA") {
eurgaT.spawn(0, false, true);
}
else if(event.value == "Repair Request") {
repairT.spawn(0, false, true);
}
else if(event.value == "In-Field Service Request") {
infieldT.spawn(0, false, true);
}
else if(event.value == "Select Form") {
coverT.spawn(0, false, false);
this.deletePages(1);
}
}
}
Copy link to clipboard
Copied
A spawned page cannot be hidden, but it can be deleted. Even with Acrobat Reader.
You can have an "always hidden" template that store data in fields that have the same name.