cancel
Showing results for 
Search instead for 
Did you mean: 

Read Table Java script

Former Member
0 Kudos

Hi,

By Calling webservice, I'm filling one table in my interactive form.

How to read each row from that table in java script, so that based on each field value , I want to manipulate other fields behaviour.

Regards,

Ravi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Ravi,

Directly we can Read Table from WebService in JavaScript. But you can have a work around like, have one hidden table and bind all the fields of hidden table to the required table in webservice. No you can Loop that Table in JavaScript and based on each rows value you can manipulate other fields in the Form.

Regards

Pradeep Goli

Former Member
0 Kudos

Hi Pradeep,

can u give sample java script code snippet for reading data from each row? Some how Im not able to read.

And how can we read table values directly from websetrvice?

Appreciate your response.

Regards,

Ravi

Edited by: Ravi Devarasetty on Oct 22, 2009 6:30 PM

Former Member
0 Kudos

Hi Ravi,

For Example say you have your heirarchy view in Adobe Form as follow

- data (root node/subform)

--tablesubform (under data)

--table1(under tablesubform and this is table )

--headerrow (table header)

--row(table row)


// Javascript code on "tablesubform" under event "form ready" or "initialize" or Even on Submit Button "Click" (for click after 
// writing script for calling webservice then the below code must be written )

var data1;
var norows = xfa.resolveNodes("data.tablesubform.table1.row[*]").length;

for ( var i =0; i<norows; i++)
{
   data1 = xfa.resolveNode("data.tablesubform.table1.row["+i+"]").rawValue;
   // write your modifications here using data1 or by directly referencing the row field value
   // here you can even change the row's current value 
}

Regards

Pradeep Goli

Former Member
0 Kudos

Hi Pradeep,

Can you also give sytax for accessing each field in the row.

For example, in a row I have Name1, Name2 and Name3 etc. What is the syntax for accessing these fields vlaues in a row.

Regards,

Ravi

Former Member
0 Kudos

Hi Ravi,

I made a mistake...you are right if you want to access some columns in that row for eg. "Name1", "Name_Address1", "age1".

Note: carefull with your case sensitive while accessing fields.


// Javascript code on "tablesubform" under event "form ready" or "initialize" or Even on Submit Button "Click" (for click after 
// writing script for calling webservice then the below code must be written )
 
var data1,data2,data3;
var norows = xfa.resolveNodes("data.tablesubform.table1.row[*]").length;
 
for ( var i =0; i<norows; i++)
{
   data1 = xfa.resolveNode("data.tablesubform.table1.row["+i+"].Name1").rawValue;
   data2 = xfa.resolveNode("data.tablesubform.table1.row["+i+"].Name_Address1").rawValue;
   data3 = xfa.resolveNode("data.tablesubform.table1.row["+i+"].age1").rawValue;
   
   // write your modifications here using data1 or by directly referencing the row field value
   // here you can even change the row's current value 
}

Regards

Pradeep Goli

Former Member
0 Kudos

Thank you Pradeep,

How can we read table directly from Webservice without having table in the form?

Regards,

Ravi

Former Member
0 Kudos

Hi Ravi,

Without having binding defined I dont think so its possible to read Table directly from WebService.

Regards

Pradeep Goli

Former Member
0 Kudos

Hi Pradeep,

In your first response, you mentioned :

"Directly we can Read Table from WebService in JavaScript" . so just want to know how is it possible..

Thank you very much

Regards,

Ravi

Former Member
0 Kudos

Hi Ravi,

It's an mistake Do read it as "Directly we can't Read Table from WebService in JavaScript"

Regards

Pradeep Goli

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Ravi,

Many thanks for sharing the above code snippet and solving my half problem... while doing so is there any way we can get on which page the particular lies.... I am referring to the similar problem faced by

Link: [Srini R|;.

If you can throw some light and guide...

Regards,

Ankeet Pujara