How to set up a default value in execDialog
Dear All,
I need to show a default value in the first field of two of the execDialog function.
Is there a way to do this ?
Thanks in advance,
//Sample of what I am looking for :
var dialogTitle = "Please confirm";
var defaultAnswer = "No.";
var reply = app.response("Did you really mean to type that?", dialogTitle, defaultAnswer);
//Script I need to modify for showing a variable in the first field :
var dialogmdp = {
initialize: function (dialog) {
// Showing the date.
var todayDate = dialog.store()["date"];
todayDate = "Date: " + util.printd("dd mmmm, yyyy", new Date());
dialog.load({ "date": todayDate });
},
commit:function (dialog) {
var results = dialog.store();
},
description:
{
name: "Password generator", // Dialog box title
align_children: "align_left",
width: 350,
height: 200,
elements:
[
{
type: "cluster",
name: "''ctrl+c'' this password and ''ctrl+v'' it in the second field for verifying if they are similar ",
align_children: "align_left",
elements:
[
{
type: "view",
align_children: "align_row",
elements:
[
{
/*******************************************************where I need to fill in the field with a variable as default value******************************************/
type: "static_text",
name: "Generated password to copy : "
},
{
item_id: "fnam",
type: "edit_text",
alignment: "align_fill",
width: 300,
height: 20
}
]
},
{
type: "view",
align_children: "align_row",
elements:
[
{
type: "static_text",
name: "past it to verify if it has been stored in the clipboard: "
},
{
item_id: "lnam",
type: "edit_text",
alignment: "align_fill",
width: 300,
height: 20
}
]
},
{
type: "static_text",
name: "Date: ",
char_width: 25,
item_id: "date"
},
]
},
{
alignment: "align_right",
type: "ok",
ok_name: "OK"
}
]
}
};
app.execDialog(dialogmdp);
