Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

_xx.removeInstance(0) problem

Avatar

Former Community Member

I have a form that has 9 pages,

I want to dynamically remove the 1st page by clicking a button.

so I wrap the entire 1st page in a sub-form,

flowed,

min count  0,

initial count 1.

and the _xx.removeInstance(0) is in the click event of the button.

but when I click it, the 1st page got wiped clean, it doesn't remove the page, it just make the page blank.

Is there a way to get rid of the 1st page completely?

thanks

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Can you send me the form and I will give it a try ...send it to LiveCycle8@gmail.com Please include a description of the issue in the email.

Paul

View solution in original post

8 Replies

Avatar

Former Community Member

You removed the page but you did not remove the Master Page instance....I bekieve that is what the blank page is.

Paul

Avatar

Former Community Member

how do I remove the Master Page instance?

I don't understand.

Avatar

Former Community Member

Lets validate that before we go down that path. Can you put a button on your Master Page (outside the content area) and add this javascript code to the click event of the button:

app.alert(this.somExpression)

Now run your form and remove the page as before. Is the button there? If so press it and let me know what is in the dialog box.

paul

Avatar

Former Community Member

yes the button is there. 

the popup says:  xfa[0].form[0].DD[0].#pageSet[0].Page1[0].Button2[0]

Avatar

Former Community Member

Then that prooves that the master page is still there .....not sure if ths will work or not but lets try the command:

DD.pageSet.Page1.instanceManager.removeInstance(0)

Paul

Avatar

Former Community Member

The otehr thing you can try is instead of removing the instance of your initial page try changing its presence to hidden. This shoudl hide the page and the Master page and omit them from the layout.

Paul

Avatar

Former Community Member

it's the same result, I still got a blank page.

(setting the presence to hidden also leaves a blank page, same as before)

in the Javascript console, there's a message saying "DD" is not defined... but in the form designer Hierarchy, "DD" is the root of the form.

Avatar

Correct answer by
Former Community Member

Can you send me the form and I will give it a try ...send it to LiveCycle8@gmail.com Please include a description of the issue in the email.

Paul

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