6 Replies Latest reply on Dec 30, 2012 9:21 PM by George_Johnson

    Looking for an sample code - first_tab & next_tab

    Jim MacD

      Looking for sample code, used within a dialog box, which uses 'first_tab' & 'next_tab'. Can anyone supply a sample working copy which uses this code? Yes, I've read the reference books - don't understand it and can't get it to work.

       

      Thanks, in advance.

        • 1. Re: Looking for an sample code - first_tab & next_tab
          gkaiseril MVP & Adobe Community Professional

          Probably not possible in a dialog object.

          • 2. Re: Looking for an sample code - first_tab & next_tab
            dcidev Level 4

            Looking for the same thing.

            • 3. Re: Looking for an sample code - first_tab & next_tab
              Jim MacD Level 1

              Hi - ever discover how this works within a dialog box?

              • 4. Re: Looking for an sample code - first_tab & next_tab
                George_Johnson MVP & Adobe Community Professional

                You place the "first_tab" element in the "description" of the dialog object, giving it a value of the name of the control that you want to have the focus initially. Don't leave this out. Then for each control that can receive the focus, include the "next_tab" item that points to the name of the next control in the tab order. I usually place it right after the "item_id" for the control. If you need a sample, post again.

                • 5. Re: Looking for an sample code - first_tab & next_tab
                  Jim MacD Level 1

                  Hi, Would really like an example. Been trying to figure this out for over a year.

                  • 6. Re: Looking for an sample code - first_tab & next_tab
                    George_Johnson MVP & Adobe Community Professional

                    OK, try this. You can place it in the Mouse Up event of a button:

                     

                    var demoDlg = {

                     

                        DoDialog: function(){return app.execDialog(this);},

                     

                        initialize: function(dialog){

                            var d_init = {  // Set the text field values to indicate their tab order position

                                "txt1": "Second",

                                "txt2": "4th",

                                "txt3": "First",

                                "txt4": "3rd"

                            };

                            dialog.load(d_init);

                        },

                     

                        description: {

                        first_tab: "txt3",  // *** Set this to the name of the first control in the tab order

                        name: "Tabbing Demo Dialog",

                        elements:[

                        {

                            type: "view",

                            width: 250,

                            elements: [

                            {

                                type: "view",

                                width: 240,

                                elements: [

                                {

                                    type: "edit_text",

                                    item_id: "txt1",

                                    next_tab: "txt4",  // txt4 will receive the focus next

                                    width: 200

                                },

                                {

                                    type: "edit_text",

                                    item_id: "txt2",

                                    width: 200

                                },

                                {

                                    type: "edit_text",

                                    item_id: "txt3",

                                    next_tab: "txt1",  // txt1 will receive the focus next

                                    width: 200

                                },

                                {

                                    type: "edit_text",

                                    item_id: "txt4",

                                    next_tab: "txt2",  // txt2 will receive the focus next

                                    width: 200

                                }

                                ]

                            },

                            {

                                type: "ok",

                            }

                            ]

                        }

                        ]

                        }

                    };

                     

                    demoDlg.DoDialog();