Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Get Data from specific Page

Avatar

Avatar
Validate 1
Level 1
dennis0512
Level 1

Likes

0 likes

Total Posts

7 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
dennis0512
Level 1

Likes

0 likes

Total Posts

7 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
dennis0512
Level 1

31-10-2019

Hi,

I have a Form that roughly Looks like this:

HIERACHY.PNG

For Explanation:

i have two Masterpages "FIRSTPAGE" and "NEXTPAGE" with FIRSTPAGE having two Content Areas. Subform "HEADER_INFO" is displayed in "CA_HEADER_FIRSTPAGE". Subform "MAIN_AREA" is displayed in "CA_FIRSTPAGE". The table "FLOATING_TABLE" can grow dynamically depending on the data. If it grows too big, it expends into Masterpage "NEXTPAGE" Content area "CA_NEXTPAGE".

For the data, i get Infos on working Hours for several employees. The form than can look something like this:

  • Page1: Data of Employee 123 (Masterpage: FIRSTPAGE)
    • Textfield PERSNR = 123
  • Page2: Data of Employee 123 (Masterpage: NEXTPAGE)
  • Page3: Data of Employee 456 (Masterpage: FIRSTPAGE)
    • Textfield PERSNR = 456
  • Page4: Data of Employee 456 (Masterpage: NEXTPAGE)
  • Page5: Data of Employee 456 (Masterpage: NEXTPAGE)
  • Page6: Data of Employee 789 (Masterpage: FIRSTPAGE)
    • Textfield PERSNR = 789
  • Page7: Data of Employee 789 (Masterpage: NEXTPAGE)

What i want to achieve is that in Textfield PERSNR_NEXTPAGE of NEXTPAGE the value of Textfield PERSNR of corresponding FIRSTPAGE is displayed. I cannot think of a solution here. When i just script in PERSNR_NEXTPAGE like " this.rawValue = this.parent.parent.parent.BODYPAGE.HEADER_INFO.PERSNR.rawValue; "

i get following result:

  • Page1: Data of Employee 123 (Masterpage: FIRSTPAGE)
    • Textfield PERSNR = 123
  • Page2: Data of Employee 123 (Masterpage: NEXTPAGE)
    • Textfield PERSNR_NEXTPAGE = 789
  • Page3: Data of Employee 456 (Masterpage: FIRSTPAGE)
    • Textfield PERSNR = 456
  • Page4: Data of Employee 456 (Masterpage: NEXTPAGE)
    • Textfield PERSNR_NEXTPAGE = 789
  • Page5: Data of Employee 456 (Masterpage: NEXTPAGE)
    • Textfield PERSNR_NEXTPAGE = 789
  • Page6: Data of Employee 789 (Masterpage: FIRSTPAGE)
    • Textfield PERSNR = 789
  • Page7: Data of Employee 789 (Masterpage: NEXTPAGE)
    • Textfield PERSNR_NEXTPAGE = 789

So as you can see there is the wrong PERSNR displayed on NEXTPAGE. What i think i Need to do is address the specific page i want to get the data from like

" this.rawValue = xfa.resolveNode("#page[ x ].HEADER_INFO.PERSNR").rawValue; " but i do not know how to do this properly.

Can anyone help me please?

Regards,

Dennis

Accepted Solutions (0)

Answers (1)

Answers (1)

Avatar

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

269 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

269 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile
_Bruce_Robertson
MVP

14-11-2019

Hi Dennis,

You will have to use the layout methods to work out which page you are on and to work out which page the appropriate PERSNR field is on.

You will also have to do this in the ready:layout event, so there could be a performance hit.

Anyway, this JavaScript code in the ready:layout event of the PERSNR_NEXTPAGE should do what you are after;

var persnr;

all:for (var i = xfa.layout.absPage(this); i >= 0; i--) { // work backwards from the current page

  var fields = xfa.layout.pageContent(i, "field"); // get all fields on the page

  for (var j = 0; j < fields.length; j++) {

    if (fields.item(j).name == "PERSNR") { // look for PERSNR field

      persnr = fields.item(j).rawValue; // if found remember value, otherwise go back another page

      break all;

    }

  }

}

this.rawValue = persnr;

Regards

Bruce