cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Accessing Context Data with JavaScript in Adobe Form

Former Member
0 Likes
3,678

Hi,

does anybody know, how to access a context element with javascript in an adobe form, because I have to decide which elements will be shown at the form, depending on one context value.

Thank you for your help!

Kind regards, Patrick.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Likes

Hi,

First of all your WD context is mapped to the data view in the form. You can only access via scripting what is mapped to the data view and you get the values that the PDF currently has stored. The WD context and the data values in the context might differ (eg. due to editing).

Use scripting like xfa.resolveNode("xfa.dataset.data.<path.to.the.node>") to get a reference to the data node.

Then you can use the "value" property to access the data value.

Regards

Juergen Hauser

dstjacques
Participant
0 Likes

Hi

Using the xfa.resulveNode or anything else, is it possible to know the number of rows directly from the context table?

Scenario:

Context table: tb_items

The context table is not bind to any layout but we need to know the number of rows.

If the tb_items would be assigned to the layout, we would be able to use the following code

var nbrRows = $.instanceManager.count

But if it is not bind how can we get the number of rows?

The following code doesn't work it end in code error.

var cnt xfa.resolveNode("xfa.dataset.data.Main.tb_items").count ;

var cnt xfa.resolveNode("xfa.dataset.data.Main.tb_items").length ;

RegardsDaniel