我正在创建自定义 PDF 对话框,但在获取输入的值时遇到问题。我检查了代码,找不到问题所在。当我按接受并显示输入到 field1 中的值时,它显示“未定义”。任何有关错误所在的指示都会有所帮助,提前致谢。
[// Dialog Definition]
var oDlg = {
field1: "",
field2: "",
field3: "",
field4: "",
// [* initialize: Method that runs when the dialog is created*]
initialize: function(dialog) {
var dlgInit = {
"firstLine":this.field1,
"secondLine":this.field2,
"thirdLine":this.field3,
"forthLine":this.field4,};
dialog.load(dlgInit);
},
// [* commit: Method called when OK button is selected*]
commit: function(dialog) {
var data = dialog.store();
this.field1 = data["firstLine"];
this.field2 = data["secondLine"];
this.field3 = data["thirdLine"];
this.field4 = data["forthLine"];
},
// [* description: Actual dialog box fields *]
description: {
name: "Test Dialog",
elements: [ {
type: "view",
elements: [ {
name: "Additional Information",
type: "static_text",
},
{
name: "(For Further Credit, Reference of other Information)",
type: "static_text",
},
{
item_id: "firstLine",
type: "edit_text",
char_width: 35
},
{
item_id: "secondLine",
type: "edit_text",
char_width: 35
},
{
item_id: "thirdLine",
type: "edit_text",
char_width: 35
},
{
item_id: "forthLine",
type: "edit_text",
char_width: 35
},
{
type: "ok_cancel",
},
] },
] }
};
[// Dialog Activation]
if( "ok" == app.execDialog(oDlg)) { // [* ok_cancel button was pressed with ok *]
app.alert("The value is: "+oDlg.field1,3);
}
最佳答案
http://www.aiim.org/documents/standards/pdf/AcroJS.pdf
第 99 页 - item_id 描述:
"An ItemID for this dialog, which is a unique 4- character string."
你的问题现在有点老了,但也许我的回答可以帮助其他人。 ;)
关于javascript - PDF Acro javascript 对话框问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22106330/