Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

How do I create a dynamic growing table which holds ”copies” of the footer Row from several instances?

Jixin_001
Level 1
Level 1

Mission:        

To create a summary table with Rows from several (yet to be determined) instances

Coordinates of the enemy   (or Row in question):  
ROOT.category[*].sub_category_total.sub_category_summary.Row1

Background information:

An order form with option for several categories (2 – 10) with subcategories (2 – 20).

Since the finished form might be up to 20 pages long I would like to get to the point
with a click of a button (so to speak)

Therefore a summary list seems the only logic solution.

Reward:

Unending gratefulness and publishing of finished sample for others to learn from

Additional Note:

Should you choose to accept this mission I will never deny your existence and will
always give credit to whom credit belongs.

This message will NOT self-destruct.    

 
5 Replies
Jixin_001
Level 1
Level 1

Hi Steve,

thank you so much ... that is exactly what I need.

But could you please be so kind and upload your attachment again.

share-footers.pdf (79.6 K) QUEUED  (???)

Sorry for the trouble and thanks again.
Steve_L_Walker
Level 10
Level 10

Send me a private message with an email address and I will forward the form.

Jixin_001
Level 1
Level 1

Hi Steve,

thanks for the example ... nice and close but not 100 % solution.

The sample requires me to set up the summary table with fixed rows.

But I don't know how many main categories & subcategories will be there - it can vary between 2 and 20.

One solution would be to set up a table with 20+ rows and hide them if rawValue ... equals 0.

Might work -  but is not very elegant ....

I guess I was looking for the script that counts the instances and then creates automatically the necessary rows.

I know it is a lot to ask in a forum ... but I guess it might be possible. Isn't it??

Please let me know if I'm reaching for the impossible 

Jixin

Steve_L_Walker
Level 10
Level 10

Yes, it is possible. If the number of footer rows will equal to the number of subform instances, you can iterate over an xfa node and find the number of occurences of the class name "subform". For example, the following script will find all the subforms on page 1.

var oNodes = page1.nodes;
var subFormCnt = 0;
for (var i=0; i < oNodes.length; i++) {
    if (oNodes.item(i).className == "subform") {
        subFormCnt++;
    }
}
xfa.host.messageBox("There is " + subFormCnt + " subform(s).");