6 Replies Latest reply on Mar 5, 2012 7:26 PM by George_Johnson

    Custom Dialog Box

    Milton123321 Level 1

      Good afternoon,

       

      Is there anyway to make a custom dialog box?

       

      for example, when you use the app.alert object, it only allows you to edit the text. Is there any way I can add in a picture to the left?

        • 1. Re: Custom Dialog Box
          Bernd Alheit Adobe Community Professional & MVP

          Look at the dialog object in the Acrobat Javascript API Reference.

          • 2. Re: Custom Dialog Box
            Milton123321 Level 1

            Thank you for pointing me in the right direction; however, I need some guidance on how to take it futhur. I have modified and implemented this document level script. I have 2 problems:

             

            var TestDlg1 =

            {

                description:

                {

                    name: "AlertStarTreck",

                    elements:

                    [

                       {

                          type: "view",

                          elements:

                          [

                             {

                                item_id: "sta1",

                                name: "Check the box",

                                type: "static_text",

                             },

                          ]

                       },

                       {

                          item_id: "CustomButtons",

                          name: "Understood",

                          type: "button",

                       },

                     ]

                  }

            };

             

            When I click the "understood button" in the dialog box, it does nothing. How do I insert a line of code to unload the dialog box? I had to alt f4 to close it?

             

            I do not see how to input a JPG (i.e. logo) in the dialog box. How do I do this with this code?

             

            As you can see, I am not doing any massive amount of data transfer. I just want a custom alert box with a logo and a custom "Ok" button.

            • 3. Re: Custom Dialog Box
              George_Johnson MVP & Adobe Community Professional

              The following page includes a link to a sample document that has examples of different types of dialogs, including ones that have images. You can study the code to see how it's done. If you need to do this a lot, AcroDialogs is a very useful tool.

              • 4. Re: Custom Dialog Box
                try67 MVP & Adobe Community Professional

                The names of elements in a dialog must be 4 characters long. If you rename the button to "btn1", then you can include this component in your dialog code to close it when it is pressed (it needs to be at the top-most level, the same as the description component):

                 

                 

                btn1: function(dialog) {

                    dialog.end();

                },

                • 5. Re: Custom Dialog Box
                  Milton123321 Level 1

                  Mr Johnson,

                   

                  Were you refering to a specific link? I dont see it?