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.
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.
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();
North America
Europe, Middle East and Africa
Asia Pacific