0

我正在使用 Adob​​e Livecycle Designer ES2 制作一个自定义对话框,但我不知道如何甚至是否可以获得两种类型:“ok” - 那里的元素做不同的事情。

我想在底部有一个常规的 OK 按钮,我想在顶部有一个指向网站的超链接。

这已经使我无法使用“ ok_cancel”等,因为据我所知,这些按钮在布局中是不可分离的。
我不知道如何为要启动 URL 的按钮制作事件处理程序,或者是否甚至可以处理“提交”之外的“ok”-Elements 的点击事件。
另外我不明白“提交”函数是如何选择它的确定按钮的,因为在我的另一个对话框中,它是由代码底部的下确定按钮触发的,这与上按钮触发的情况不同“提交”功能。

这是我的代码以使其更清晰-我不希望“链接”元素触发“提交”,而是触发“okbo”元素。我想为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 ;)

4

1 回答 1

3

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

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

•   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

请参阅此来源的更多详细信息

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);
于 2014-10-08T18:44:32.930 回答