cancel
Showing results for 
Search instead for 
Did you mean: 

Field value from master page

pekka_pottonen
Participant
0 Kudos

Hello,

I have asked this Q in Adobe forums but received no answer yet. Please see link.

field value from master page |Adobe Community

Does anyone here have a solution to help me to proceed.

Best Regards

Pekka

Accepted Solutions (0)

Answers (2)

Answers (2)

prajeshdesai
Contributor
0 Kudos

Try to access master page field on docReady event,

Also read Adobe Forms: Process Events

More details :

Hope this helps.

Former Member
0 Kudos

Hi Pekka,

I posted a blog long time ago that explains how to access data nodes. Accessing from fields is very similar.

Accessing data nodes in SAP Interactive Forms | SCN

For form fields "datasets" needs to be replaced with "form" and "value" with "rawValue".

Regards,

Juergen

pekka_pottonen
Participant
0 Kudos

Hi Juergen,

Statement like this returns the value from the first existing masterpage(Erittely_etusivu).

this.rawValue = xfa.form.data.pageSet.erittely_set.Erittely_etusivu.Headeri.INVOICE_NO_E.rawValue;

If I want to access the n:th master page, where I have to put the index? I also tested this.rawValue = "this.parent.index" and it returns zero...

Subform Headeri is located top on the masterpage, not on the content area.

Br,

Pekka

Former Member
0 Kudos

Hi Pekka,

Not sure if I'm missing a detail here. So I'm explaining how to navigate fields on master pages in general.

The blog used parent.index to get the sequence number of the subform (i.e. the number of the instance of this subform) to construct a SOM (scripting object model) expression, like subform[2] to address the third instance.

Assuming a subform on the master page with two text fields.

This script in layout:ready assigns the page number TextField1 is on as value to TextField 2. Shows you how to find out the number of the page your field is on (index in other words) and how to address another field on the master page avoiding the use of an index.

Script is for TextField1:

this.parent.TextField2.rawValue = xfa.layout.page(this);

The SOM expression completion helps you with finding the right fields (subfroms). You can use parent.parent to navigate.

Page1 is the master page the subform is on. The following script copies a value from one field on the master page to another field on the master page. I added a string so that I can see if the value really was copied. There is some magic involved as the indices are always on the current instance of the page/subform when the script is run.

this.rawValue = xfa.resolveNode("xfa.form.data.pageSet.Page1.Subform1.TextField1").rawValue + "JH";

Hope this helps.

Best,

Juergen

pekka_pottonen
Participant
0 Kudos

Hi Juergen,

Please find here here

Bundle.pdf - Google Drive

the resulting pdf.

If you look at the page 10 and the field "Laskun numero". It has value null with the coding like this,

data.#pageSet[0].erittely_set.Erittely_next.Headeri2.INVOICE_NO::ready:layout - (JavaScript, server)

this.rawValue = this.parent.INVOICE_NO.rawValue + "9";

Goal is to get the values from subform Headeri from the page 9, which is the first page of the invoice(with the number 97786337) and the page 10 is the overflow. It can be possible that all the invoices will overflow, but in this example only one.

Also this returned nothing

this.rawValue = xfa.resolveNodes("xfa.form.data.pageSet.erittely_set.Erittely_etusivu.Headeri[9].INVOICE_NO_E").rawValue;

Br,

Pekka

Former Member
0 Kudos

Hi Pekka,

Sorry for the delay in getting back to you. I help out on SCN in my spare time.

Is this still open?

If so: Any chance you can share the XDP and a sample data set? You should find my email address if you click on my name on this post.

There are some limitations in accessing field instance across multiple master page instances.

Looking at your form, if you would have asked me how to structure the form I would have said that the address/invoice number should be on the body page and not the master page.

Best,

Juergen

pekka_pottonen
Participant
0 Kudos

Hi Juegen,

Case still open. Had so much other stuff to do that this had to wait a bit.

I could not find email, but all docs are in the google drive for you to download.

https://drive.google.com/open?id=0B4yVgDi3fxjWQVBSZnRYblVudUE

Appreciate if you can solve this

If you need further info or docs, you can find my email from my profile data.

Br,

Pekka

pekka_pottonen
Participant
0 Kudos

Hi Juergen,

Did you have any chance to explore the documents I put out for you to download?

Still need to solve this.

Br,

Pekka