Highlighted

Layout changing for the Dialog box

Community Beginner ,
Aug 07, 2020

Copy link to clipboard

Copied

Hello,

 

I have question regarding layout, I have noticed when I'm trying to run the dialog box from the Button action its comming Image 1Image 1 

 

But when i'm trying to run it from the Debugger, it's retruning the below one, Can someone guide me what changes i need to require to get the below box from the button action

Image 2Image 2

TOPICS
Comment review and collaborate PDF, Create PDFs, Edit and convert PDFs, Install update and subscribe to Acrobat, PDF forms, Print and prepress, Rich media and 3D, Scan documents and OCR, Standards and accessibility

Views

64

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Layout changing for the Dialog box

Community Beginner ,
Aug 07, 2020

Copy link to clipboard

Copied

Hello,

 

I have question regarding layout, I have noticed when I'm trying to run the dialog box from the Button action its comming Image 1Image 1 

 

But when i'm trying to run it from the Debugger, it's retruning the below one, Can someone guide me what changes i need to require to get the below box from the button action

Image 2Image 2

TOPICS
Comment review and collaborate PDF, Create PDFs, Edit and convert PDFs, Install update and subscribe to Acrobat, PDF forms, Print and prepress, Rich media and 3D, Scan documents and OCR, Standards and accessibility

Views

65

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Aug 07, 2020 0
Most Valuable Participant ,
Aug 07, 2020

Copy link to clipboard

Copied

You need to run the code from a trusted context in order to get rid of that warning.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 07, 2020 0
Community Beginner ,
Aug 07, 2020

Copy link to clipboard

Copied

I have tried to run with trusted function, but It's not working, Can you please guide me what is wrong with the Java script 

myTrustedGetGlobal = app.trustedFunction ( function(dialog)
{

app.beginPriv();
var dialog1 = {
initialize: function (dialog) {
// Create a static text containing the current date.
var todayDate = dialog.store()["date"];
todayDate = "Date: " + util.printd("mmmm dd, yyyy", new Date());
dialog.load({ "date": todayDate });
},
commit:function (dialog)
{ // called when OK pressed
var results = dialog.store();
// Now do something with the data collected, for example,
console.println("Your name is " + results["fnam"]
+ " " + results["lnam"] );
},
description:
{
name: "Personal Data", // Dialog box title
align_children: "align_left",
width: 350,
height: 200,
elements:
[
{
type: "cluster",
name: "Your Name",
align_children: "align_left",
elements:
[
{
type: "view",
align_children: "align_row",
elements:
[
{
type: "static_text",
name: "First Name: "
},
{
item_id: "fnam",
type: "edit_text",
alignment: "align_fill",
width: 300,
height: 20
}
]
},
{
type: "view",
align_children: "align_row",
elements:
[
{
type: "static_text",
name: "Last Name: "
},
{
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_cancel",
ok_name: "Ok",
cancel_name: "Cancel"
}
]
}
};
app.execDialog(dialog1);
app.endPriv();
});

 

 

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 07, 2020 0
Adobe Community Professional ,
Aug 07, 2020

Copy link to clipboard

Copied

If the trusted function is being run in the document context, it won't work. Trusted functions need to be loaded from a folder level script. 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 07, 2020 0
Community Beginner ,
Aug 10, 2020

Copy link to clipboard

Copied

Thanks for your reply, I I undertand that 

I have created Docment Level Java Script

var dialogTrust = app.trustedFunction(function(data)
{
app.beginPriv();
 var d = dialog(data);
 d.execDialog();
 
app.endPriv();

 

 

and Put the below code on Mouse Up action 

var dialogTrust = app.trustedFunction(function(data)
{app.beginPriv();
var data = { 
description: { name: "Test Dialog", elements: [
{ name: "Hello World", type: "static_text", },
{ type: "ok", },
] } }; 
app.execDialog(data);app.endPriv();
});


});

 

I have tried this example but did not work

https://answers.acrobatusers.com/Remove-warning-JavaScript-window-message-dialog-q225486.aspx

 

Could you please guide me what I'm doing wrong 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 10, 2020 0
Adobe Community Professional ,
Aug 10, 2020

Copy link to clipboard

Copied

You can't define a trusted function at a Mouse Up event. Use a folder level script.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 10, 2020 0