Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

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

Avatar

Level 1

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

5 Replies

Avatar

Level 10

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

Avatar

Level 1

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

Level 10

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

Level 1

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

Level 10

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