XML feed into tables on javascript repeated subforms - Help Please.

Avatar

Avatar

adamh93921072

Avatar

adamh93921072

adamh93921072

30-05-2019

Hi, I am new to Livecycle so don't know all the terms so please bear with me, only started using this yesterday.

I have created a form with subforms and I have written some javasript to duplicate instances based on a text field entered (if count is < 'textfield')

I have also mapped some XML into the original table in subfield 1

my issue is how do I get multiple sets of data into the new instances? each table in the new instance should hold the next set of data.

I am sorry if this has been asked before, I had a look but couldn't see.

Each table could hold different amounts of rows and there could be as many as 100 tables to populate.

BatteryVoltsIntR
111.871264
212.741164
311.981246

4

11.97

1228

512.111267
611.991255

And

BatteryVoltsIntR
1121244
211.871274
3

11.96

1250
412.01

1276

Accepted Solutions (0)

Answers (5)

Answers (5)

Avatar

Avatar

_Bruce_Robertson

MVP

Total Posts

1.8K

Likes

268

Correct Answer

372

Avatar

_Bruce_Robertson

MVP

Total Posts

1.8K

Likes

268

Correct Answer

372
_Bruce_Robertson
MVP

02-06-2019

Hi,

I think the version of JavaScript in the latest versions of Reader/Acrobat are ES5, I think the let keyword came out in ES6, so you should use "for (var i = 0; i < 100; i++)".

Also, in Acrobat under Edit ... Preferences ... JavaScript.  Make sure you have "Enable JavaScript debugger" set, when exception is thrown to break, enable interactive console, and show console or errors and messages"

In your case you should see a message "SyntaxError: missing ; after for-loop initializer"

Use Ctrl-J to bring up the JavaScript debugger.

Here are some links which might help;

Using the Acrobat JavaScript Debugger with XFA

http://adobelivecycledesignercookbookbybr001.blogspot.com/2015/03/adobe-livecycle-designer-tip-8-bri...

http://adobelivecycledesignercookbookbybr001.blogspot.com/2014/04/adobe-livecycle-designer-tip-3-set...

Regards

Bruce

Avatar

Avatar

adamh93921072

Avatar

adamh93921072

adamh93921072

02-06-2019

so I am taking your advice on board and using a button, but I seem to be just swapping 1 problem for another.

what am I doing wrong?

2019-06-02 (1).png

Avatar

Avatar

_Bruce_Robertson

MVP

Total Posts

1.8K

Likes

268

Correct Answer

372

Avatar

_Bruce_Robertson

MVP

Total Posts

1.8K

Likes

268

Correct Answer

372
_Bruce_Robertson
MVP

31-05-2019

Hi,

You are right in setting the presence property to visible will make a hidden object visible.  But I'm not sure about your code, seems to be when you leave an instance of Row1 you though all the sibling Row1 objects and make their parent visible.  You could just to Result4.presence = "visible", as you can always access the parent objects without a resolveNodes (unless you have another object with the same name it finds first).  But also not sure how the exit event is being fired on a hidden object, do you have an execEvent('exit') call somewhere?

Bruce

Avatar

Avatar

adamh93921072

Avatar

adamh93921072

adamh93921072

31-05-2019

ok reading your response does make my original question sound stupid, as I said i'm new to this.

while I have been thinking about it I have created multiple pages containing the tables flowed and hide them. idea is I will then make them visible when row count > 0 or maybe 1 as there is a formula in the row so always returns 1 and the data set can't be valid if 1.

How do I make the page visible using javascript. I am here right nowLivecycle1.png

Avatar

Avatar

_Bruce_Robertson

MVP

Total Posts

1.8K

Likes

268

Correct Answer

372

Avatar

_Bruce_Robertson

MVP

Total Posts

1.8K

Likes

268

Correct Answer

372
_Bruce_Robertson
MVP

30-05-2019

Hi,

I'm not sure I follow, what do you mean by "the new instance should hold the next set of data", is this data coming from the XML or is it coming from some script based on the data in the original table?

Regards

Bruce