Expand my Community achievements bar.

SOLVED

I am new. Need help with Subforms

Avatar

Level 2

I have followed posts and figured out how to use buttons to add and remove subforms but I would like the subforms to add where the button is not to the end of the list.  Remove works this way but I haven't gotten add to work. Any help would be greatly appreciated.

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

You will need to do it in two steps .....do the add (it will put it at the bottom) then do a moveInstance.

Paul

View solution in original post

4 Replies

Avatar

Correct answer by
Former Community Member

You will need to do it in two steps .....do the add (it will put it at the bottom) then do a moveInstance.

Paul

Avatar

Level 2

Oh my...I don't know how to do that either.

Um....

form1.requirements.Subform1.instanceManager.moveInstance(this.parent.index - 1);

?

Avatar

Former Community Member

Its a from/ to model......moveInstance (from an Index, to an Index) Remember that the indexes are 0 based but the count is 1 based. I updated you code for you in this modified sample.

Paul

Avatar

Level 2

That works! Thank you very much!

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