Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Copy data from one table cell to another table cell problem

Avatar

Level 4

add  :

SF0.instanceManager.addInstance(0)

SF2.instanceManager.addInstance(0)

SF3.SF4.instanceManager.addInstance(0

i have a form in which 3 table present in three subform "SF0", "SF2" (SF2 Repeating Subform ) and "SF3.SF4"  (SF3 & SF4 Both Subform and SF4 Repeating Subform)

when i copy data from SF0.Table1.Row1.Cell1 to SF2.Table1.Row1.Cell1 by this.rawValue = SF0.Table1.Row1.Cell1.rawValue  work fine in all instance field

But when copy data from SF0.Table1.Row1.Cell1 to SF.SF4.Table1.Row1.Cell1 by   this.rawValue = SF0.Table1.Row1.Cell1.rawValue    only first value copy in all new add instance field.

plz helpUntitled.png

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

I'm note sure I understand the forms structure, usually it would be Row1 that would repeat, but you seem to be repeating a block containing a table of one row?

The approach would be the same, you need to find out which row of the second table you are in and reference the that row in the source table., so something;

this.rawValue = SFO.all.item(SF2.index).Table1.Row1.Cell1.rawValue

The index property will return the position in like named items so it we are in the second row of the SF2 table we reference the second row of SFO.

Regards

Bruce

View solution in original post

3 Replies

Avatar

Level 7

You will need to reference the row instance you want to copy to.

I wrote up some information here which will point you in the right direction.

Avatar

Correct answer by
Level 10

Hi,

I'm note sure I understand the forms structure, usually it would be Row1 that would repeat, but you seem to be repeating a block containing a table of one row?

The approach would be the same, you need to find out which row of the second table you are in and reference the that row in the source table., so something;

this.rawValue = SFO.all.item(SF2.index).Table1.Row1.Cell1.rawValue

The index property will return the position in like named items so it we are in the second row of the SF2 table we reference the second row of SFO.

Regards

Bruce

Avatar

Level 4

thanks for quick support

correct script as per your suggestion is

xfa.resolveNode("SF0["+SF4.index+"].Table1.Row1.Cell1").rawValue;

it is working fine.