Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Scripts stop working when extended with "additional features"

Avatar

Former Community Member

I have a couple of scripts that work fine in both Pro and Reader, but when I Save As -> Reader Extended PDF -> Enable Additional Features, they stop working (in both Pro and Reader). Other scripts in the same form continue to work just fine. I'm at a total loss, and so are my IT folks (who admittedly aren't exactly form/JS/Adobe experts...)

I've been fighting with this problem off and on for a week or so now, and I've tried a couple of different approaches - I'm a JS muddler, and I'm sure there are more effective ways to do what I want to do. But everything I try gives me a different problem . I'm going to try to separate out the different issues in different posts...but I'm getting pretty confused!

For what it's worth, the problem scripts are on the first and last master page, while the ones that work are on regular pages.

The goal is to reuse a partially filled-out form for several different phases of an approval process. Each version gets a different title, and an additional subform is visible during the 2nd, 3rd, and 4th phases.

Here's the overall workflow:

  • Phase 1
    1. The form starts out with the Phase 1 title and with the additional subform "hidden."
    2. A remote user fills out the form and returns it to the program coordinator.
  • Phase 2/3/4
    1. The coordinator saves a copy of the form with a different name.
    2. The coordinator checks a "For admin use only" checkbox to display a radio button group. Each option changes the title and sets the additional subform presence to "visible."
    3. The coordinator unchecks the "For admin use only" checkbox to hide the radio buttons.

The title is in a text field. The scripts change the rawValue of the field for each option.

In this case, I have the following script in both the initialize and calculate events of the text box:

if   (S_SelectTitle.S_Actions.RB_SelectTitle.rawValue == 2)

     this.rawValue = "Phase 2";

else if (S_SelectTitle.S_Actions.RB_SelectTitle.rawValue == 3)

     this.rawValue = "Phase 3";

else if (S_SelectTitle.S_Actions.RB_SelectTitle.rawValue == 4)

     this.rawValue = "Phase 4";

else

     this.rawValue = "Phase 1";

and similar code in the initialize and calcuate events of the subform to make its presence "visible" or "hidden." (I've used this initialize/calculate event strategy before, it's always worked fine. But I"ve run into problems with it in one of the alternate approaches i've been using on this form, so I"m totally open to other ways of doing it...)

Before I extend the form for Reader, it works fine. The title changes correctly depending on which button is selected, the new subform appears at the end, and the radio buttons go away when the box is unchecked.

After I extend it for Reader, nothing works except the checkbox. The title doesn't change, and the subform never appears.

Help? Thanks in advance!

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Well, it seems that interactive objects on master pages are problematic. Using a few message boxes, we discovered that the Initialize event fires each time a radio button on a master page is selected, but not when the radio button is in the body of the form.

So each time we clicked the radio button on the master page, the Initialize event set the value of the exclusion group right back to the default value (which was null, in this case). So the title never changed, because the radio button setting didn't stick.

For this form, I figured out a way to remove the radio buttons from the master page. Not only do the titles in the headers change correctly, the form also works with the Reader extensions enabled!

I'm not sure which issue was hanging me up -- the buttons on the master page or Reader extensions -- or if they're tied together somehow. But the moral of the story for me, anyhow, is no more buttons on master pages. Hope this helps someone else!

View solution in original post

1 Reply

Avatar

Correct answer by
Former Community Member

Well, it seems that interactive objects on master pages are problematic. Using a few message boxes, we discovered that the Initialize event fires each time a radio button on a master page is selected, but not when the radio button is in the body of the form.

So each time we clicked the radio button on the master page, the Initialize event set the value of the exclusion group right back to the default value (which was null, in this case). So the title never changed, because the radio button setting didn't stick.

For this form, I figured out a way to remove the radio buttons from the master page. Not only do the titles in the headers change correctly, the form also works with the Reader extensions enabled!

I'm not sure which issue was hanging me up -- the buttons on the master page or Reader extensions -- or if they're tied together somehow. But the moral of the story for me, anyhow, is no more buttons on master pages. Hope this helps someone else!

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----