BindRef not working for repeatable panels in AEM forms

Avatar

Avatar
Validate 10
Level 3
rohitn62196663
Level 3

Likes

12 likes

Total Posts

66 posts

Correct reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile

Avatar
Validate 10
Level 3
rohitn62196663
Level 3

Likes

12 likes

Total Posts

66 posts

Correct reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile
rohitn62196663
Level 3

14-09-2018

I am currently working on forms in AEM 6.3. I have a repeatable panel where customer enters address info. I also have a summary page which shows the summary of the address info. So the address info panel in summary section has the same bind ref as the address info section where the customer enters data. However when customer enters something in address info its not getting reflected in the summary section. If its not a repeatable panel then its working. So does the bind ref wont work for repeatable panels ?

Replies

Avatar

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

327 likes

Total Posts

1,150 posts

Correct reply

185 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

327 likes

Total Posts

1,150 posts

Correct reply

185 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile
Mayank_Gandhi
Level 10

14-09-2018

I Guess this is expected as you do not have a single instance where you can interact and set the values directly. You might have to the use the instances API in InstanceManager to set the field value of  partular instance . The syntax to use the instances API in InstanceManager is:

<panelName>.instanceManager.instances[<instanceNumber>].<fieldname>

For example, you create an adaptive form with a repeatable panel having a text box. When you pre-fill the form with three repeatable text boxes, you need the xml below:

<panel1><textbox1>AA1</panel1></textbox1>

<panel1><textbox1>AA2</panel1></textbox1>

<panel1><textbox1>AA3</panel1></textbox1>

To read AA1 data, specify:

Panel1.instanceManager.instances[0].textbox.value

To read AA2 data, specify:

Panel1.instanceManager.instances[1].textbox.value

Avatar

Avatar
Validate 10
Level 3
rohitn62196663
Level 3

Likes

12 likes

Total Posts

66 posts

Correct reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile

Avatar
Validate 10
Level 3
rohitn62196663
Level 3

Likes

12 likes

Total Posts

66 posts

Correct reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile
rohitn62196663
Level 3

20-09-2018

Thanks for your response Mayank.

So if that is the case, then for repeatable panels in order to display the same data in summary either I need to use the calculate event on each form field to display the value in summary or I need to write javascript code in order to update the summary panel whenever there is a change in the form fields.

Bind ref is not going to be helpful for this use case in repeatable panels then.

Avatar

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

327 likes

Total Posts

1,150 posts

Correct reply

185 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

327 likes

Total Posts

1,150 posts

Correct reply

185 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile
Mayank_Gandhi
Level 10

21-09-2018

You can handle that I guess in code editor pretty well. The above approach seems fine to me,