13 Replies Latest reply on Aug 15, 2015 6:45 AM by try67

    UI

    Learn2Gro

      Hi Team,

       

      Hope you are doing good.

       

      I just wanted to know, if its possible to create UI panel in Acrobat, with check boxes, tick boxes etc., like Indesign javascript UI panel.

       

      Many thanks for your support.

        • 1. Re: UI
          try67 MVP & Adobe Community Professional

          Yes, using the Dialog object, but unlike in ID (I believe) it is a modal window, meaning you can't (directly) interact with the underlying document while it is open.

          Read the documentation of the execDialog method of the app object for a lot more information about this subject.

          • 2. Re: UI
            Learn2Gro Level 1

            Hi try67,

             

            Thanks for your quickest reply.
            Would be much appreciated, if you can help me by posting example codes here. Please. Also suggest me the url to find the documentation for execDialog method.

             

            Thanks for your immediate support.

            • 3. Re: UI
              try67 MVP & Adobe Community Professional

              The documentation is available here: http://www.adobe.com/devnet/acrobat/javascript.html

              There are examples there.

              • 4. Re: UI
                Unique Level 1

                HI try67,

                 

                Please accept my apology for the delayed reply. Thanks for the link. I tried with that to buil User Interface panel.
                Just need a help on that.

                 

                If i have selected the drop-down list 'A', then the dialog should load the value of the other drop-downs automatically instead of keystroke enter.

                 

                Hi try64, thanks for the link and sorry for the delayed response. Managed to create the User Interface panel with the support of the link.

                 

                However I cant able to find the action events like button.onClick etc.,

                 

                The below is the code im using. So there will be 3 drop-downs  A, B and C and drop-down A will have list like "S1", "S2", "S3" and the drop-down B will be empty list likewise dropdown 'C'. When S1 is selected or clicked, the dialog should load the list items in drop-down B and when anyone of the value in 'B' is selected then dialog should load some list in 'C' dropdown, Please see below code and please advice.

                 

                if (accntList=="S1") {

                dialog.load({

                A:

                {

                "MyName": -1,

                "YourName": +1,

                "HisName": -2,

                "OurName": -3

                }})

                }

                 

                if (accntList=="S2") {

                dialog.load({

                B:

                {

                "xxxx": -1,

                "yyyy +1,

                "zzzzz": -2,

                }})

                }

                 

                if (accntList=="S3") {

                dialog.load({

                B:

                {

                "xxxxAAA": -1,

                "yyyyBBB: +1,

                "zzzzzCCCC": -2,

                }})

                }

                 

                Thank you.

                • 5. Re: UI
                  try67 MVP & Adobe Community Professional

                  So what exactly is your question?

                  Oh, and each item in the list needs to have a unique value (whether it's positive or negative). So you can't have one value with "+1" and one with "-1"...

                  • 6. Re: UI
                    Unique Level 1

                    Hi try67, thanks your speedy reply.

                     

                    I want help from you for this. dialog should store the values of all the selected drop-down list when applied ok, but now, the selected value again restored +1 value and not the selected value.

                     

                    Any help please. If need I will clearly explain one more...

                     

                    Thank you very much for the support.

                    • 7. Re: UI
                      Unique Level 1

                      Hi Team,

                       

                      No problem.

                       

                      I Just wanted to know, if there's any action event available to popup list in drop-down just when onSelect event is applied.

                      At present the popup list is displayed only when return button or 'APPLY' key in UI-dialogue panel is pressed.

                      {

                      app.beginPriv();

                      var oDlg = {

                      accountName: "",

                      operatorNames: "", initialize: function(dialog) {

                       

                      dialog.load({"txt1":this.accountValue});

                      dialog.load({"txt2":this.operatorNames});

                       

                      commit: function(dialog) {

                      var results = dialog.store();

                      this.accountName = results["txt1"];

                      this.operatorNames = results["txt1"];

                      },

                       

                      validate:function(dialog) {

                      accountNames = "";

                      for (i in results["txt1"]) {

                      if (results["txt1"][i]>0)

                      accountNames= i;

                      }

                       

                       

                      if (operatorNames=="US") {

                      results = dialog.store();

                       

                      dialog.load({

                      sub2:

                      {

                      "Unique": +1,

                      "Razak,

                      "Humdin": -2

                      }

                      })

                      },

                      description:

                      {

                      name: "Country_Operators", // Dialog box title

                      elements:

                      [

                      {

                      type: "view",

                      elements:

                      [

                      {

                      name: "Account Name",

                      type: "static_text",

                      },

                      {

                      item_id: "txt1",

                      type: "popup",

                      width: 300,

                      height: 30

                      },

                       

                       

                      {

                      name: "Operator Name",

                      type: "static_text",

                      },

                      {

                      item_id: "txt2",

                      type: "popup",

                      width: 300,

                      height: 30

                      },

                       

                      item_id: "but01",

                      type: "ok",

                      ok_name: "APPLY",

                      },

                      ]}

                      ]}

                      app.execDialog(oDlg);

                       

                      app.endPriv();

                      }

                       

                      Any help is much appreciated..

                       

                      Thanks.

                      • 8. Re: UI
                        try67 MVP & Adobe Community Professional

                        You can define a function with the name of a component in the dialog and it will launch when the value of that component is changed.

                        • 9. Re: UI
                          Unique Level 1

                          Hi try67,

                           

                          Hope you are doing good. Thanks for that.

                           

                          Any bit of sample code will help me much better.

                           

                          Thank for your immediate reply.

                          • 10. Re: UI
                            try67 MVP & Adobe Community Professional

                            Between the "validate" and "description" functions, for example, you can add something like this:

                             

                            txt1: function(dialog) {

                                 app.alert("Value of \"txt1\" has changed.");
                            },

                             

                            You can get the current value of the field using the dialog's store method, just like you do in the validate or commit functions.

                            • 11. Re: UI
                              Unique Level 1

                              Hi try67,

                              Fantastic. Thanks for you help. Its really help indeed.

                              Great support.

                              • 12. Re: UI
                                Unique Level 1

                                Forum, so How do i make it as correct answer.

                                • 13. Re: UI
                                  try67 MVP & Adobe Community Professional

                                  It already is...