on 04-01-2007 11:37 PM
Hello
I need to create a table of content on a separate body page. This TOC shows the page numbers of materials listed in the document. The document has its own body page.
Since I have to use Designer 7.0 I have created the following script in the layout:ready event of the following material field of the catalog page:
ZMAT_KATALOG.Catalog.IT_KATALOG.DATA.Table1.Row1.MATNR::ready:layout
function SetPageNum(pMatNr,pPageNum) {
// get all recurring DATA nodes of TOC
var aData[] = xfa.resolveNodes
("xfa.form.ZMAT_KATALOG.TableOfContent.IT_MAT4TOC.DATA");
for ( i=0; i < aData.length; i++ ) {
//set page number if material number matches the TOC line
if ( aData.Table1.Row1.MATNR.rawValue == pMatNr ) {
aData.Table1.Row1.PagNum.rawValue = pPageNum;
}
}
}
try {
//copy page number of current material to TOC
var vPageNum = xfa.layout.page(this);
var vMatNr = this.rawValue;
SetPageNum( vMatNr, vPageNum );
} catch (e) {
}
ZMAT_KATALOG -> form
TableOfContent -> body page of TOC
Catalog -> body page of document
Could anybody evaluate my script and give me a hint what might be wrong? Thanks in advance.
René Morel
Hi Rene,
1) Does xfa.resolveNodes
("xfa.form.ZMAT_KATALOG.TableOfContent.IT_MAT4TOC.DATA"); resolve?
2) maybe you can add a alert box in your script to debug your code.
3) you can also use the debugger.
4) in your catch block, also add an alert box to see if the script runs there as well.
cheers,
Noë
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Rane,
Can you pls tell me how did you solve your problem..It will be helpful for me..i have same issue.
BM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rene,
JavaScript debugger is integrated into Acrobat Professional. Procedure is described on the page 68 http://www.adobe.com/devnet/livecycle/articles/lc_designer_scripting_basics/lc_designer_scripting_ba...
You can use debugger with Adobe Reader but it isn't such easy. Page 45 in
http://partners.adobe.com/public/developer/en/acrobat/sdk/pdf/javascript/AcroJSGuide.pdf
You will need debugger.js : http://partners.adobe.com/public/developer/en/pdf/debugger.js
Debugger doesn't use ADS.
In your code, you can use command: debugger;
and command: console.println("YOUR MESSAGE");
Michal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Noel
Thank you for responding. I tried the alert message before but didn't obtain any result. I' going to try again tomorrow.
Do you think that my script is syntactically correct?
How can I invoke the Debugger in ALD 7.0?
Can I use it in the preview modus (with sample XML data) or only in conjunction with ADS?
Regards
René
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.