Expand my Community achievements bar.

SOLVED

Subforms within subforms add Instance problem

Avatar

Level 1

Hi

I am new to Adobe Livecycle Designer (I am using version 8.2.1) but I have successful made nearly all elements of the quite long form I need to produce except for one section I am having difficulty getting it to function correctly. In the example I have a repeating subform ‘Organisation’ on page subform ‘Membership’ which has buttons to add and remove instances, which work correctly. But within each instance of this ‘Organisation’ subform is another repeating instance subform ‘ExpertNames’ with buttons to add and remove instances.

The ‘Organisation’ form allows an organisation to be named and the ‘ExpertNames’ subform allows multiple members for that organisation to be named and associated to each organisation. The user should be able to list multiple organisations each with one or more members. I can successfully add multiple instances of ‘Organisation’ form one after another using

Membership.Organisation.instanceManager.addInstance(1)

and remove the selected instance using

Membership.Organisation.instanceManager.removeInstance(this.parent.index)

I have the following set on the button to add a new instance of the ‘ExpertNames’ form

Membership.Organisation.ExpertNames.instanceManager.addInstance(1);

and the following to remove the selected instance of the 'ExpertNames' form

Membership.Organisation.ExpertNames.instanceManager.removeInstance(this.parent.index);

However when I add a second instance of the ‘Organisation’ form i.e. a new organisation and try and add additional members to the 2nd organisation it adds them to the 1st organisation rather than the second! I have an example of the problem form i can send if needed.

Hope someone will be able to help with this.

Many thanks in advance

Lara

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Send the form to LiveCycle8@gmail.com and include an explanation of the issue and I will have a look when I get a chance.

Paul

View solution in original post

8 Replies

Avatar

Level 10

Send your form to nith.mof@gmail.com

I will try to correct the issues.

Nith

Avatar

Level 1

I still have not been able to find a solution to this does anyone have any ideas?

I have an example of the problem in a form that I can email.

Many thanks in advance

Lara

Avatar

Correct answer by
Former Community Member

Send the form to LiveCycle8@gmail.com and include an explanation of the issue and I will have a look when I get a chance.

Paul

Avatar

Level 1

Many thanks to pguerett, for such a quick reply to my problem, for anyone with a similar problem the following line of JavaScript suggested by pguerett used with the add instance button worked perfectly for me.


xfa.resolveNode("Membership.Organisation[" + this.parent.index + "].ExpertNames").instanceManager.addInstance(1);

Avatar

Level 4

hello I too have the same problem. I have a subform that repeats itself and to the inside of this subform exist another repeating subform.

I tried using the code:

  xfa.resolveNode ("MODULO.pagina [" + this.parent.index + "]. sub_work"). instanceManager.addInstance (1);

but does not work, you can give me some help?

thank

Avatar

Level 5

It all depends where you execute this code from as it has this.parent in the code fragment you tried. Check your hierarchy matches your expression in resolveNode. If there is a mismatch it will just return null

Avatar

Level 4

hello, thanks for the answer.
Unfortunately I have solved my problem in this thread I explain what I should do there is also the attached form. If you could give me a help

http://forums.adobe.com/thread/968626?tstart=0

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