7 Replies Latest reply on Aug 19, 2015 12:45 PM by try67

    app.execDialog returns an empty dialog box??

    tlubins Level 1

      Hello

       

      I have been having this problem for a while now. I want to have my custom dialog box open back up right after an alert pops up. I made an "ok" button that calls the dialog box and I had to insert the entire dialog code into the button using the "Run JavaScript". If I simply put app.execDialog the dialog box would pop up as intended but all of the selection fields would be blank. After playing around I gave up and inserted the entire code into the button and it runs perfectly. Now though, I need to use the app.execDialog again because I have an app.alert that comes up only if certain selections are picked. If the user picks those selection the app.alert pops up and tells the user that they cant pick those and to go back and pick again which is where I put the app.execDialog at. When you click "okay" on the app.alert to go back to the dialog box it does pop up and the static text is there and the clusters and popups, but, there is absolutely nothing in the popups themselves. Is there a way around this? I have searched on google and in this forum for quite a bit and asked my friend a few weeks ago when he was still here and we could not find an answer on how to fix this anywhere. I can insert an example program from dropbox as well. Thank you! I hope this was descriptive enough!

        • 1. Re: app.execDialog returns an empty dialog box??
          tlubins Level 1

          Here is a dropbox link to a pdf for what I am talking about. This is exactly what I am working on with some content taken out and changed. The initial dialog box that pops up when you open the link can be ignored or filled in. The problem area is the "Dialog Button" when you click on it there is no content inside of the drop downs anymore.

          Dropbox - eductor_67.pdf

          • 2. Re: app.execDialog returns an empty dialog box??
            try67 MVP & Adobe Community Professional

            I think this is happening because you're re-using the same Dialog object multiple times.
            Try the following: Return the dialog from a function, let's say it's called getSection1(). Then call that function both in the doc-load script and in your button script, so the code in them would be something like:

            app.execDialog(getSection1());

            That way you get a new object each time you call it and you won't get conflicts by using the same object multiple times.

            I did a small test and it seemed to work...

            • 3. Re: app.execDialog returns an empty dialog box??
              tlubins Level 1

              Thank you for the reply!

               

              I just tried it out and I think I am doing it wrong. So when you say return the dialog do you mean to make a new script or instead of say,

                  var Section1 =

                      {

                        script

                      };

              it would be:

                  function getSection1()

                    {

                      script

                    };

              The second example is what I had tried and it did not work. I am still new to coding so what you are saying makes a  little sense in words but applying it I still get lost.

              I also tried to just insert a function that says

                  function getSection1()

                    {

                      app.execDialog(Section1)

                    }


              and then I put the function inside the button script but, nothing happened. A dialog box didn't even come up. I know I am doing this wrong but, I just wanted to show you that I did try it but, I need some guidance as to where I went wrong. Thank you for any help you may provide me! I truly appreciate it!

              • 4. Re: app.execDialog returns an empty dialog box??
                try67 MVP & Adobe Community Professional

                No, it should be:

                 

                function getSection1() {

                     var Section1 = {

                          // dialog definition

                     }

                 

                     return Section1;

                }

                • 5. Re: app.execDialog returns an empty dialog box??
                  tlubins Level 1

                  Thank you! That worked almost perfectly! My fields aren't generating anymore and there are a couple bugs but, I think I can work through those myself! Thank you again for such quick responses!

                  • 6. Re: app.execDialog returns an empty dialog box??
                    tlubins Level 1

                    Am I supposed to change anything within the fields that referenced the dialog box? I am going through everything trying to figure out why nothing is working anymore except for the dimensions but I cant seem to find out where it is breaking. It worked fine before I put that code in there and now that I did nothing is updating. Thank you for the help again!

                    • 7. Re: app.execDialog returns an empty dialog box??
                      try67 MVP & Adobe Community Professional

                      This is a complex code. I'm not entirely sure what the problem is, and it will take quite a lot of work to fully understand the code and be able to solve any issues with it...

                      • 8. Re: app.execDialog returns an empty dialog box??
                        tlubins Level 1

                        Okay thats fine! No worries, I will try and figure it out which I am sure I will eventually haha. Yeah it is kind of complex and to be honest I dont know if I even understand it 100% and I was the one who wrote the code haha. Anyways, Thank you for your help! I really appreciate it.

                         

                        One more question, the person who I am making this for asked me if it is possible to put shading in one of the dropdowns in the dialog box to shade out some options and make 2 options stand out. I told him I am fairly certain that is not possible to do and he asked if I could maybe make them bold? The materials Carbon Steel and 316(L)SS he wants to be bold or to stand out some way, is this possible to do? I am almost positive it is not since I don't think you have that kind of ability to customize the dropdowns do you? Or to order them in a custom particular way and the way I would want them to be ordered (non alphabetical)?

                        • 9. Re: app.execDialog returns an empty dialog box??
                          try67 MVP & Adobe Community Professional

                          No, you can't change the appearance of just some items in the list. You can set the entire list to be bold, though (I haven't tried it, but it should work).

                          If you want to make a specific item more visible you can add an asterisk before and after it, maybe...