If your secondary is of type "dialog", you can do it for instance this way: function getUserData(x, y){ var result = null; var win; var i, j, pnl, gr; win = new Window("dialog", "Enter Values:"); win.orientation = "column"; win.pnls = win.add("group{orientation: 'row', alignChildren: ['left', 'top']}"); for (i=0; i<x; ){ pnl = win.pnls = win.pnls.add("panel"); ++i; pnl.text = "Barre " + i; pnl.alignChildren = ['fill', 'top']; pnl.margins = 15; for (j=0; j<y; ){ gr = pnl = pnl.add("group"); gr.orientation = 'column'; gr.alignChildren = 'left'; gr.spacing = 0; gr.margins = 0; ++j; gr.titleSt = gr.add("statictext"); gr.titleSt.text = "Value " +j+ " :"; gr.data = gr.add("edittext"); gr.data.text = "0"; gr.data.preferredSize = [200, -1]; }; }; win.footer = win.add("group"); win.footer.orientation = 'row'; win.footer.applyBTN = win.footer.add("button", undefined, "Apply", {name:"OK"}); win.footer.cancelBTN = win.footer.add("button", undefined, "Cancel", {name:"Cancel"}); win.footer.applyBTN.onClick = function(){ var tempresult = []; var text, tempvalue; var message=""; outer : for (i=0; i<x; i++){ tempresult = []; for (j=0; j<y; j++){ text = win.pnls .data.text.replace(",", "."); tempvalue = Number(text); if ( isNaN(tempvalue) || (/^\s*$/.test(text)) ){ win.pnls .data.active = true; message = isNaN(tempvalue) ? ("Invalid number input : " + win.pnls .data.text) : ("Please fill all fields"); break outer; } else{ tempresult = tempvalue; }; }; }; if (message){ // invalid field : alert and dont close alert(message); } else{ // all valid : validate and close result = tempresult; this.window.close(1); }; }; win.show(); return result; }; var userData = getUserData(3,4); You would need to adapt a bit for a "palette". Xavier
... View more