Expand my Community achievements bar.

SOLVED

How do I make sure AddInstance adds the extra pages in the order I want?

Avatar

Level 2

My project is nearly complete. All thats left is to get the add instance button at the bottom of the second page to function in the way I want. Currently it's set on click with the following script.

statcardform.frontpage.instanceManager.addInstance(1);

statcardform.backpage.instanceManager.addInstance(1);

When I click the button it adds a copy of the frontpage after the original frontpage, and a copy of the backpage after the original backpage. This is not what I had in mind. I need it to keep each front and backpage together, and add each repeated front and back page after the backpage so if you were to click the button multiple times you would get several copys of the same two page form.

frontpage

backpage

frontpage

backpage

frontpage

backpage

etc...

Currently what it does is this

frontpage

frontpage

frontpage

backpage

backpage

backpage

How can I fix this so it works the way I want?

The binding tab for each page is set to "Repeat Subform for each Data Item" and an initial count of "1" with no minimum and no maximum.

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Why not wrap the front and back page into another subform (I will call it doc). Then you woudl only have to repeat doc.

Make sense?

Paul

View solution in original post

2 Replies

Avatar

Correct answer by
Former Community Member

Why not wrap the front and back page into another subform (I will call it doc). Then you woudl only have to repeat doc.

Make sense?

Paul

Avatar

Level 2

Perfect, that worked exactly how I needed it too. Thanks for all your help Paul.

Aaron

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