I created a dynamic stamp and it works fine.
However, there is a small blemish and I would like to have the OK button centered. But I just can't do it.
I hope someone has an idea how I can do it.
Here is my Dialogbox. And here is the code:
Code: Select all
if (event.source.forReal && (event.source.stampName == "#n2h6j4ssD6YLY7bvr2CUh2")) {
var dialog = {
retErledigt: "",
DateValue: "",
initialize: function(dialog) {
//dialog.load({"raA3": true}); // option A3 is default
//Textfeld "txt1" erhält den Standardtext (aktuelles Datum)
var todayDate = dialog.store()["date"];
todayDate = util.printd("dd.mm.yy", new Date());
dialog.load({"txt1": todayDate});
dialog.load({"txt2": 1});
},
//Speichern der Werte aus dem Custom-Dialog in den Dialog-Variablen
//siehe hierzu den Header
commit: function (dialog) { // called when OK pressed
var data = dialog.store();
this.DateValue = data["txt1"],
this.SeitenValue =data["txt2"];
},
description:
{
name: "Faxstempel", // Dialog box title
elements:
[
{
type: "view",
align_children: "align_top",
elements:
[
{
name: "Datum: ",
type: "static_text",
width: 50,
},
{
item_id: "txt1",
type: "edit_text",
multiline: false,
bold: true,
width: 80,
height: 20
},
]
},
{
type: "view",
align_children: "align_top",
elements:
[
{
name: "Seiten: ",
type: "static_text",
width: 50,
},
{
item_id: "txt2",
type: "edit_text",
multiline: false,
bold: true,
width: 80,
height: 20
},
]
},
{
type: "view",
align_children: "align_center",
elements:
[
{
type: "ok",
ok_name: "Ok",
},
]
},
]
}
}
//if (event.source.forReal && (event.source.stampName == "#caseandnumblue")) {
if ("ok" == app.execDialog(dialog)) {
//aktuelles PDF-Formfield erhält den Wert
event.value = dialog.SeitenValue;
//Windows Login-Name
//Zwischenspeichern des Textfeld mit dem Datum
var d;
d = dialog.DateValue
d = d.replace( /,/g, "." );
d = d.replace( /\//g, "." );
//app.alert(d)
//Konvertierung String d in cDate
var cDate = util.scand("dd.mm.yy", d);
//PDF-Formfield mit neuem Wert befüllen und Datum richtig formatieren
this.getField("txtDate").value=util.printd("dd.mm.yy", cDate);
}
}
Thanks.
Nimrod