Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.
SOLVED

page visibility after save

Avatar

Level 2

I have a pdf form with the following.

page1 = visible
page2 = hidden

Page 2 can be made visible by clicking a button on page1.

The problem I'm having is that after I make page2 visible, save it and then re-open the form page 2 is still hidden.

*the form has been saved as dynamic.

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Try this

if(ShowpageTick2011.rawValue == 1){   //if tickbox flag is ticked
    form1.WM2012.presence = "visible";
}
else{
    form1.WM2012.presence = "hidden";
}

View solution in original post

4 Replies

Avatar

Former Community Member

Hi,

you can write a script on presave event to hide/show the page before saving your form.

Avatar

Level 2

Hi chalukya, thanks for the suggestion.  Unfortunalty this did not work either.  I programmaticly call for the page to be hidden and this works but looks like my call to make the page visible does not seem to make any effect after I save and reopen the file.

The way I've done the page visibilty is based on a button click and a tick box (eventually this tickbox will be hidden as well).

page 1 is called WM2011 and page2 is called WM2012

This is the code I've got on the button click.


xfa.resolveNode("WM2012").presence = "visible";  //When user clicks button set the visiblity of page2(WM2012) to visible.

ShowpageTick2011.rawValue = 1;  //when user clicks button set tickbox flag on

This is the code I've gotten on initialise of page1

if(ShowpageTick2011 == 1){   //if tickbox flag is ticked
    form1.WM2012.presence = "visible";
}
else{
    form1.WM2012.presence = "hidden";
}

Avatar

Correct answer by
Former Community Member

Try this

if(ShowpageTick2011.rawValue == 1){   //if tickbox flag is ticked
    form1.WM2012.presence = "visible";
}
else{
    form1.WM2012.presence = "hidden";
}

Avatar

Level 2

Thanks for that I belive your right, the '.rawValue' was missing.

I didn't use your code exactly but what I did was on the initialie of the tickbox I did the following.

if(this.rawValue == 1){
    form1.WM2012.presence = "visible";
}
else{
    form1.WM2012.presence = "hidden";
}

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] ----