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

Copy the value of a cell in an other tab.

Avatar

Level 2

Hi,

First of all, I'm french. I hope you could understand my poor english.

I've a got a form with a tab where u can ad or sup raws.

I've gat a second tab.

I'd like to copy the value of the cell (textfield) in a cell in the second tab.

I've try "this.rawValue = evolution.forobj.tab1.r1.txt1.rawValue ;" in change event but it doesn't work.

Thanks for your help.

Nath

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi Nath,

This should work in the calculate event of the object in tab2:

this.rawValue = evolution.forobj.tab1.r1.txt1.rawValue;

The language should be set to Javascript.

There is another way to tackle this without script. So if you can't get this to work, come back.

Niall

Assure Dynamics

View solution in original post

4 Replies

Avatar

Level 10

Hi Nath,

Your English is much better than my French

The change event fires when the user is inputting data into the object that contains the script. As you have it in the change event of the object in tab 2, it does not fire at all when the user is inputting data into the object in tab 1.

Also the change event needs xfa.event.newText and not .rawValue.

I would recommend that you move the script to the calculate event of the object in tab 2. This way as soon as the user leaves the object in tab 1, the information will be undated in the object in tab 2.

Good luck,

Niall

Assure Dynamics

Avatar

Level 2

Thx a lot, Niall,

I hope i've correctly understood your answer.

My event is already in the first tab but doesn't work.

and newText doesn't work anymore.

Sorry, i'm a kind of dumb with programmation ;)

Thanks for your help.

Nath

Avatar

Correct answer by
Level 10

Hi Nath,

This should work in the calculate event of the object in tab2:

this.rawValue = evolution.forobj.tab1.r1.txt1.rawValue;

The language should be set to Javascript.

There is another way to tackle this without script. So if you can't get this to work, come back.

Niall

Assure Dynamics

Avatar

Level 2

It works perfectly !

Thanks a lot !