Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

correct use of app.trustedFunction ?

Avatar

Former Community Member

Hello,

I have a function1 which launch a diaglog when a user clicks on the button. Function1 is in the folder script.  For the click event, I have: script1.function1();


However, the dialog box has the title "JavaScript Window" and the warning "Warning: JavaScript Window".

I searched and follow the suggestion in the forum.  I created a app.trusted fuction as below:

 

var

vDialog = app.trustedFunction(function() {

      app.beginPriv();

      launchDialog();

     app.endPriv();

});

In the click event, I have:

 

     event.target.vDialog();

However, this doesn't work.  Could someone points out for me where the mistake is?  Also, is there a way to change the windown title, instead of "JavaScript Window", it says "Help Information"?

Thank you.

4 Replies

Avatar

Level 10

Hi,

check this thread, I think this is what you're looking for.

http://forums.adobe.com/message/3714841#3714841

Avatar

Former Community Member

I already looked at all the thread.  Not sure why my code is not working.  I tried all scenarios recommended by the references and the posts in this forum.  As soon as I wrap the function with the trustedFunction, the function is no longer working.

Avatar

Level 2

Is your PDF certified? and do you trust the certificate?

Kind Regards

Kevin Mortimer

Solutions Architect

Avoka

www.avoka.com

Avatar

Level 6

You might want to look at the documentation for the app.trustPropagatorFunction:

http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.168.html

Example #2 shows how you can prevent the JavaScript warning in the title. To set the title of the dialog, set the "name" property (in the description object) to the string you want to use.