gpt4 book ai didi

javascript - 如何在 Adob​​e-JS 自定义对话框中使用多个“确定”按钮?

转载 作者:行者123 更新时间:2023-11-28 19:33:54 26 4
gpt4 key购买 nike

我正在使用 Adob​​e Livecycle Designer ES2 制作自定义对话框,但我不知道如何或是否可以获取两个 type:"ok"- 元素在其中执行不同的操作事物。

我想在底部有一个常规的“确定”按钮,并且我想在顶部有一个指向网站的超链接。

这已经阻止我使用“ok_cancel”等,因为据我所知,这些按钮在布局中是不可分离的。
我不知道如何为启动 URL 的按钮创建事件处理程序,或者是否可以处理“ok”-“commit”之外的元素的单击事件。
另外,我不明白“提交”函数如何选择其确定按钮,因为在我的另一个对话框中,它是由位于代码底部的下部确定按钮触发的,与本例中上部按钮触发的情况不同“提交”功能。

这是我的代码,让它更清楚 - 我不希望“link”元素触发“commit”,而是“okbo”元素。我想为“link”的 clickEvent 创建一个新函数。

var dialogBox =
{
description:
{
elements:
[{
type: "static_text",
name: "Text about the link",
},
{
type: "ok",
item_id: "link",
ok_name: "Go to Link",
},
{
type: "static_text",
name: "Some more Information",
},
{
type: "ok",
item_id: "okbo"
}]
},
commit: function(dialog)
{
app.alert("This is triggered by the OK-Button with the ID 'link' \n and I don't know why!");
}
};
app.execDialog(dialogBox);

如果不可能在一个对话框中使用不同的“ok”元素,我愿意就如何以不同的方式在我的对话框中获取超链接提供建议!

这是我的第一个 StackOverflow 问题,所以请不要杀了我 :P ;)

最佳答案

请参阅下面更新的代码和我的评论。有关 Dialog 和 execDialog 函数的更多详细信息,请参阅 here .

一些控件没有记录,例如:

•   link_text: a hyper link control
• mclv: a multi-column list view (or grid)
• slider: a slider
• ok_help, ok_cancel_help, ok_other_help, ok_other_cancel_help controls
• separator: draw a line horizontal or vertical with optional caption
• Heading and Title fonts about 10pt and 12pt respectively
• margin_width, margin_height properties for the view control
• back_color, gradient_direction, gradient_type for the view control
• A Dialog.setForeColorRed() method
• A Dialog.visible() method to show/hide controls

查看更多详细信息 source

var dialogBox =
{
description:
{
elements:
[{
name: "Link to google",
type: "link_text", // add a hyperlink
item_id: "lnk1",
alignment: "align_center",
},
{
type: "static_text",
name: "Text about the link",
},
{
type: "button", // add a custom button
item_id: "link",
name: "Go to Link",
alignment: "align_center",
},
{
type: "static_text",
name: "Some more Information",
},
{
type: "ok",
item_id: "okbo"
}]
},
commit: function(dialog)
{
app.alert("okbo!"); //executed only for first ok type
},

"link": function () // handler of the custom component by id name
{
xfa.host.gotoURL("http://www.yahoo.com");
},

"lnk1": function ()
{
xfa.host.gotoURL("http://www.google.com");
}

};
app.execDialog(dialogBox);

关于javascript - 如何在 Adob​​e-JS 自定义对话框中使用多个“确定”按钮?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26252701/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com