cancel
Showing results for 
Search instead for 
Did you mean: 

How to access Table rows in ADOBE form

siddharth_jain
Active Contributor
0 Kudos

Hello Experts,

I want to access the Table rows which are getting populated by WDA context, in form JavaScript when the table is populated.

on the basis of few cell values i want to disable and enable particular cells in table rows when the table is rendered to the user.

Please provide your inputs and suggestion on how to write a java script for it and in which event i should write the script.

i searched SDN and found couple of blogs and threads and tried using them but not working.

Thanks,

Siddharth

Accepted Solutions (1)

Accepted Solutions (1)

OttoGold
Active Contributor
0 Kudos

1) you need to see the data coming from the backend to your form

2) you must write your script and user proper addressing, example:

you place the script on the row subform level, you write like

var help_var = this.yourfieldname.rawValue;

this.field2.rawValue = help_var;

this means the subform, where the script is placed (or field if you would place it on the field level)

you can use parent pointer to access the node one level up from your position in the form hierarchy

something like this.parent (where this means row, then this.parent means the subform for table).

Examples available here (last chapter):

http://www.adobe.com/devnet/livecycle/articles/lc_designer_scripting_basics/lc_designer_scripting_ba...

Regards Otto

Answers (3)

Answers (3)

siddharth_jain
Active Contributor
0 Kudos

Hello All,

thanks for your suggestions.

after some research and trial and error i found the solution:here is the sample code for those who might face this issue.

SUPERNODE(Root Node)

--SUBFM(SUBFORM)

-


MYNODE( Table)

-


DATA(Table ROW)

-


ADD (Table COLUMNS)

-


DELETE (Table COLUMNS)

var data1;

var norows = xfa.resolveNodes("SUPERNODE.SUBFM.MYNODE.DATA[*]").length;

for ( var i =0; i < norows; i++)

{

if( xfa.resolveNode("SUPERNODE.SUBFM.MYNODE.DATA["i"].DELETE").rawValue == "")

{

xfa.resolveNode("SUPERNODE.SUBFM.MYNODE.DATA["i"].DELETE").access = "readOnly";

}

if( xfa.resolveNode("SUPERNODE.SUBFM.MYNODE.DATA["i"].ADD").rawValue != "")

{

xfa.resolveNode("SUPERNODE.SUBFM.MYNODE.DATA["i"].ADD").access = "readOnly";

}

}

Former Member
0 Kudos

Hi

To access the rows of your table in the context, try to use the below syntax :

var fields = xfa.form.subform.table.row.all;

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

{

                        • do your code here

}

NB: It is always better to do all manipulations to your table in the back end.

Regards,

Deepa

siddharth_jain
Active Contributor
0 Kudos

Hello Experts,

Any suggestions inputs are most welcome.

Thanks,

Siddharths