Expand my Community achievements bar.

SOLVED

rearrange repeating subforms in a complicated form

Avatar

Level 4

My subform situation is a little complicated. I have attached my form for you to look at.

To recreate:

open form

click "Edit to existing course"

click Page to add an instance of the page subform

click Page to add another instance

use "Move" buttons to rearrange them

When user adds an instance of the page subform, they are really adding an instance of the parent subform Pages. This is so as the child subforms, page, discussion, assessment, dropbox are added by the user, they show up in the order the user calls them.

So, the script for the "Move" buttons need to reference that specific instance of the Page subform. I have accomplished this on my other buttons by referencing this.parent on my buttons. It's not working this time, though.

I attached a sample that Niall graciously tried to fix, but it's not working either. I need to figure out a way to make sure the script is refernencing that specific instance of _Pages.

Thanks for your help.

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Ok the issue is that you are not getting the correct subform instance index. I modified the MoveUp code to

show you . I did not do the MoveDown.

Paul

View solution in original post

2 Replies

Avatar

Correct answer by
Former Community Member

Ok the issue is that you are not getting the correct subform instance index. I modified the MoveUp code to

show you . I did not do the MoveDown.

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