These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Page function in subforms

nmara
Registered: Feb 4 2007
Posts: 102

A worker in another department has created a couple of different forms. On both forms she added the custom "Page N of M" control to her forms. It works great on the first form but just shows page 0 of 0 on the 2nd.
 
I tried looking at the code in the script editor and the only difference I can see is this.
 
The form that works looks like this:
---form1.#subform[1].CurrentPage[1]::ready:layout - (JavaScript, client)--------
 
The form that does not work looks like this:
 
---form1.#subform[0].CurrentPage::ready:layout - (Javascript, client) -----
 
If they are essentially similar documents why does one have [0] and the other have [1] after subforms? Are subforms created automatically or is that something a user has to define?
 
Thanks much,

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
I don't think that the SOM paths have anything to do with why the custom page display isn't working. These are just the headers that the script editor puts at the top for convenience. So you know what control and trigger the script is for.

"Subforms" are an integral part of the whole XFA paradigm. And yes, the ones listed in your scripting SOM path were auto-generated for a new form. "form1" is the topmost (or document) subform, followed by "#subform", which represents an un-named page subform. If you're going to do any scripting you need to rename these page subforms to something meaningful and simple.

You can also create your own subforms for controling the document layout and scripting structure.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

nmara
Registered: Feb 4 2007
Posts: 102
Thom,

Thanks for your replies. two questions:
1. What does SOM stand for?
2. How does one go about renaming page subforms so they are more meaningful??

Nat
nmara
Registered: Feb 4 2007
Posts: 102
Thom,

I had help from someone figure this out. Clarification on my end: The cells involved on the form were inside a table, so the usual sum("ActSalary,ActERE, ActOther") did not work. what ended up working was Sum(form1.#subform[0].Table3.Row1.ActSalary,form1.#subform[0].Table3.Row2.ActERE,form1.#subform[0].Table3.Row3.ActOther)

Why is that extra granularity necessary so I can explain to others?

Thanks for all of your assistance on this,

Nat