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

Instance Count + Display

Avatar

Level 2

Hi, i currently am having an issue with getting the instance manager to count and display the current number of subforms.

I have a TextField called TextField117 in a subform Called Row24, which is in a subform Called Set2.

I also have a button called Button 1 that creates a new instance of Set2 every time it is clicked.
What i am trying to do is that TextField117 gets automatically filled with the # each time the button is clicked, so in the very first set2(the original) it'll display 1.

Then when the button is clicked, it will create another set2 which has it's own textfield117, and i want that textfield117 to display 2. ( a counter). and so forth... 3, 4... 5.. 6..


If there is anyone that could help, i would appreciate it. thank you!

1 Accepted Solution

Avatar

Correct answer by
Level 10

HI there,

if you set TextField117 to Calculate - Read Only, and put code within the calculate event you can have the field show the value wanted

within the calculate event, you can write the reference_syntax needed to access the parent set2 and retrieve the index with the following :

Depends how many parents there is to access set2, you will have to adjust according to the hierarchy...

Hope this will help

View solution in original post

8 Replies

Avatar

Level 6

Since this is a question about an XFA form, I'm going to move this to the LiveCycle Designer forum: LiveCycle Designer

Avatar

Correct answer by
Level 10

HI there,

if you set TextField117 to Calculate - Read Only, and put code within the calculate event you can have the field show the value wanted

within the calculate event, you can write the reference_syntax needed to access the parent set2 and retrieve the index with the following :

Depends how many parents there is to access set2, you will have to adjust according to the hierarchy...

Hope this will help

Avatar

Level 2

Thank you magus069, it worked really well!

Avatar

Level 2

Theres one more bug ive been working on, i'm trying to replicate the information inputted in to a table outside of the set2 subform , to replicate into the table in set 2, and add instances of row 1 ( in the table outside of the set2 subform)  (which also adds instances in to the table inside of the set2 subform) I dont want to use global binding data because it will affect each row made after with the add instance button and i want them to have different text fields so that the user can input the next row of information which is automatically copied into the set 2 table.

Avatar

Level 10

You can also use the index for your purposes if I understand well your needs

Let's say your table is named Table1 and row is Row1...

Something like this could do the job if this is exactly what you are looking for

Avatar

Level 2

Uhm could i send you the form and show you what i mean? it's difficult for me to explain it properly

Avatar

Level 10

Hi again,

I'm sorry I totally forgot to answer back yesterday, if you still need assistance I can either send you my email in private message or you can send a link for me to download the PDF file.

Avatar

Level 2

Hey magus, thanks for replying, yes I still need some assistance, can I get your email?