


Hi,
I have a Form that roughly Looks like this:
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:
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:
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
Views
Replies
Sign in to like this content
Total Likes
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
Views
Replies
Sign in to like this content
Total Likes