Expand my Community achievements bar.

SOLVED

Livecycle Designer: Handling complex XML returned from LC Workbench process

Avatar

Level 2

Hi Community,

Situation: XFA Form making a Search Request:

1) I have a LC process that has an 'output' variable of type XML.

2) The XML contains repeating elements

3) The XFA form, makes a webservice call to the LC Process and stores the XML response ('search results') in a hidden text field.

4) I want to use this XML now to load a small section of the form (table) with the 'search results'

I am familiar with this method:

- xfa.datasets.data.loadXML(tfRespXML.rawValue, 0, 1);

However this re-loads the ENTIRE form with the XML

and unfortunately .loadXML() doesn't work on subforms/nodes!?!

--> Passing the entire form XML up and getting the entire form XML + search results as a response is also not an option.

Question:

1) Im very interested to know what, in your opinion, is the most convenient way to handle complex XML in a LC Form using Javascript?

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

You can call loadXML at a lower level in your dataset to retain the values higher up, such as;

xfa.datasets.data.form1.subform1.subform2.loadXML(tfRespXML.rawValue, 0, 1);

You can also use the Acrobat JavaScript Net object to call a webservice which will return a JavaScript object, which is sometimes more convenient if you are not trying to bind to the data return.

Regards

Bruce

View solution in original post

3 Replies

Avatar

Correct answer by
Level 10

Hi,

You can call loadXML at a lower level in your dataset to retain the values higher up, such as;

xfa.datasets.data.form1.subform1.subform2.loadXML(tfRespXML.rawValue, 0, 1);

You can also use the Acrobat JavaScript Net object to call a webservice which will return a JavaScript object, which is sometimes more convenient if you are not trying to bind to the data return.

Regards

Bruce

Avatar

Level 2

Thanks alot Bruce - this I will definately try.

I previously tried other means... eg:

xfa.form.form1.subform1.subform2.loadXML(...);

However, invoking the loadXML on the datasets makes 100% more sense.

Let me give this a try...

Regards,

Luigi

Avatar

Level 2

10 points for you Bruce....

Quality stuff.... all works... thank you Bruce.

With the xfa.form.merge(); invoked afterwards.....

Please drop me an email sometime:

forums   [at]    8bitplatoon   [dot]     com.