Hi,
I have created a form where I can choose some productareas.
When I choose one area a list of articles ist grow up in subform instances.
When I choose a second area the old subform instance list grows up with the new list of articles (no new instance list).
Now I want to open every productarea in a new page to have a better overview.
my old structure is like this:
PAGE --> LIST --> ROW (addInstance)
my new structure should look like this:
PAGE (addInstance) --> LIST --> ROW (addInstance)
I tried that code but nothing happend:
----------------------------------------------------------------------------
var sSubformSOM = "PAGE";
var oSubform = xfa.resolveNode(sSubformSOM);
var sParentSOM = oSubform.parent.somExpression;
var sManagerSOM = sParentSOM + "._" + oSubform.name;
var oManager = xfa.resolveNode(sManagerSOM);
var nSubCount = oManager.count;
var oNewInstance = oManager.addInstance(1);
----------------------------------------------------------------------------
My questions now are:
- how can I add a new page dynamically ?
- how can I adress that new pages to add my row instances?
1. Is the page subform and the parent set up properly to be dynamic?
2. It's not necesssary to create new instances of the page subform to get new pages. All you need to do is create page size subforms within a page and if the parent subform is setup correctly, it will grow into new pages. Any element, like your row instances, that you want to manipulate must already be on the repeated subform.
Remember, Dynamic live cycle forms don't have a solid concept of pages. The subforms labeled as pages are only there as a convenience. Really, any subform can expand to cover several pages. and still be the same subform.
3. Test out your code from the console window using absolute references to the subforms you want to create new instances of. It's possible that you are making small errors. You can get a much better handle on all that's going on by developing your code from the console window.
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script