Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

copy value in a subform

Avatar

Level 1

Hello,

In a form i have a button to add an instance of a subform. This works.

In this new instance, I'd like copy the values of the previous subform. How can i do this ?

Thanks.

2 Replies

Avatar

Level 10

Hi,

The easiest way is to set the binding of the objects to 'global', in the Object > Binding palette.

Data entered into one field will appear in the same field in all instances of the subform. This will happen on exit automatically and without scripting.

If this isn't what you want, then there are scripting options.

Niall

Avatar

Level 1

Hi,

It's not exactly what i need.

When the user click the button which add a new instance of the subform, I'd like to copy values from the previous subform to the new instance.

Then the user can change value in the new instance, with no effect on the previous one.

By setting the binding of the objects to 'global', all the objects change.