Skip to main content
Known Participant
April 29, 2017
Question

How do I keep original selection showing in drop down list

  • April 29, 2017
  • 1 reply
  • 482 views

Hi,

I have this code which loops and labels documents:

var oDocNumTypes = {

"Exhibit":{Prefix:"A"},

"Attachment":{Prefix:"B"},

"Memo":{Prefix:"C"},

"Sample ":{Prefix:"D"},

                         };

The user has to select the document type from a drop down list.  After the user selects "Exhibit" for instance from the drop down list, it labels the first document and then the second , third and so on.  However, the chosen value of "Exhibit" disappears from the drop down list.  I want it to remain throughout the looping so user does not get confused and think they need to keep selecting it each time.  How can I do this?

Original selection:

Does not retain original selection...Defaults back to showing nothing through loops

I am using Adobe Acrobat Pro X 10.1.16 on Windows 7.

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
April 30, 2017

Is this a dialog object in an Action? Something else? Please clarify.

suemo22Author
Known Participant
April 30, 2017

The answer is yes.

Here are excerpts of the code I think are relevant:

var oDocNumTypes = {

"Exhibit":{Prefix:"A"},

"Attachment":{Prefix:"B"},

"Memo":{Prefix:"C"},

"Sample ":{Prefix:"D"},

                        };

.

.

.

.

oDocNumParams:oDocNumTypes,

        initialize: function(dialog)

        {

            var listLTyp = new Object();

            this.SetListSel(listLTyp, this.strLTyp);

.

.

.

.

.

.

"LTyp": function(dialog)

        {

            var oRslt = dialog.store();

            var path = [];

            var cSel = ((this.GetListSel(oRslt["LTyp"],path))?path.reverse():"").toString();

            var oLabInfo = this.oDocNumParams[cSel];

 

            if(!oRslt["DNum"] || (oRslt["DNum"] == "") || isNaN(oRslt["DNum"]))

dialog.load({"DNum":"1"});

         

            if(oLabInfo)

            {

dialog.load({"LPfx":oLabInfo.Prefix, "DocN":oLabInfo.UseDocNum, "PgNm":oLabInfo.UsePgNum, "PPfx":oLabInfo.PagePrefix});

dialog.enable({"DNum":oLabInfo.UseDocNum, "PPfx":oLabInfo.UsePgNum, "PPsf":oLabInfo.UsePgNum});

              this.SetDocNumber(dialog,this);

            }

         

         

        },

        "PosB": function(dialog)

        {

dialog.enable({"MrgV":false});

        },

       

        "PosT": function(dialog)

        {

dialog.enable({"MrgV":true});

        },

        "PosR": function(dialog)

        {

dialog.enable({"MrgH":true});

        },

        "PosC": function(dialog)

        {

dialog.enable({"MrgH":true});

        },

        "PosL": function(dialog)

        {

dialog.enable({"MrgH":true});

        },

        description:

        {

            name: "Automatic Batch Labeling Application",

            elements:

            [

                {

                    type: "view",

                    elements:

                    [

                        {

                            type: "view",

                            alignment: "align_fill",

                            elements:

                            [

                                {

                                    type: "view",

                                    height: 14,

align_children: "align_top",

                                    elements:

                                    [

                                        {

                                            type: "static_text",

item_id: "FlNm",

name: "Please enter the information for applying document numbering labels to:",

                                            height: 14,

font: "palette",

bold: true,

                                        },

                                        {

                                            type: "static_text",

item_id: "sta1",

name: "Version 1.6.1 - 1/6/17 SCS/CA",

height: 12,

                                            alignment: "align_right",

                                        },

                                    ]

                                },

                               

                              {

                                    type: "cluster",

                                    item_id: "cls2",

                                    name: "ENTER LABEL INFORMATION",

                                    font: "palette",

                                    bold: true,

                                    elements:

                [                     

{

type: "view",

align_children: "align_row",

elements:

                                            [

                                              {

type: "static_text",

item_id: "sta3",

                                                    name: "1. Select Document Type:",

},

{

type: "popup",

                                                    item_id: "LTyp",

variable_Name: "strLTyp",

width: 93,

height: 23,

char_width: 8,

},

try67
Community Expert
Community Expert
April 30, 2017

You will need to save the selected value into a global variable and then

re-apply to the field it in the initialize event of the dialog.

On Sun, Apr 30, 2017 at 8:16 PM, sargums46564804 <forums_noreply@adobe.com>