Code: Select all
var oDlg = {
strName: "", initialize: function(dialog) {
dialog.load({"frmData":this.strLine1});
},
commit: function(dialog) {
var data = dialog.store();
this.strLine1 = data[ "txtLine1"];
this.strLine2 = data[ "txtLine2"];
},
description: {
name: "Enter Symbol Data", elements: [ {
type: "view", elements: [
{ name: "Enter Line1:", type: "static_text", },
{ item_id: "txtLine1", type: "edit_text", char_width: 50 },
{ name: "Enter Line2:", type: "static_text", },
{ item_id: "txtLine2", type: "edit_text", char_width: 50 },
{ type: "ok_cancel", },
]
},]
}
};
// Dialog Activation
if(event.source.forReal && (this.selectedAnnots[0].AP == "qC0lj9Fnk5MVjEK7Z2jDr1"))
{
if( "ok" == app.execDialog(oDlg)) {
getField("txtLine1").value = oDlg.strLine1;
getField("txtLine2").value = oDlg.strLine2;
}
}
My question is if there is a way to write some JS that the user can select the already placed dynamic stamp and run the JS to display the same dialog with the text values that were previously entered in the dialog. Then the user could edit the values and click OK on the dialog form and this would replace the text on the text fields on the stamp.
I was thinking something like this on the OK event to change the text, but it does not work
Code: Select all
// Dialog Activation
if(this.selectedAnnots[0].AP == "qC0lj9Fnk5MVjEK7Z2jDr1")
{
if( "ok" == app.execDialog(oDlg)) {
this.selectedAnnots[0].getField("txtLine1").value = oDlg.strLine1;
this.selectedAnnots[0].getField("txtLine2").value = oDlg.strLine2;
}
}
Simon