Skip navigation
Currently Being Moderated

Looking for an sample code - first_tab & next_tab

Feb 2, 2012 5:24 AM

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.

 
Replies
  • Currently Being Moderated
    Feb 2, 2012 8:50 AM   in reply to Jim MacD

    Probably not possible in a dialog object.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 16, 2012 9:10 AM   in reply to Jim MacD

    Looking for the same thing.

     
    |
    Mark as:
  • George Johnson
    9,232 posts
    Aug 11, 2002
    Currently Being Moderated
    Dec 9, 2012 1:03 PM   in reply to Jim MacD

    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.

     
    |
    Mark as:
  • George Johnson
    9,232 posts
    Aug 11, 2002
    Currently Being Moderated
    Dec 30, 2012 9:21 PM   in reply to Jim MacD

    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();

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points