5 Replies Latest reply on Feb 2, 2015 1:49 AM by Jackkistens

    windows based user interface, in dropdown list current selected array Index value how to get.

    Jackkistens

      var win = new Window('dialog', 'Simple dialog box');
      win.alignChildren = 'left';

      // Operator panel (Contains two groups)
      win.pnlOp = win.add('panel', undefined, 'Operator');

      // Name Group
      win.pnlOp.grpName = win.pnlOp.add('group');
      win.pnlOp.grpName.orientation = 'row';
      win.pnlOp.grpName.stx = win.pnlOp.grpName.add('statictext', undefined, 'Name:');
      win.pnlOp.grpName.stx.minimumSize = [60, 20];
      win.pnlOp.grpName.txt = win.pnlOp.grpName.add('edittext');
      win.pnlOp.grpName.txt.minimumSize = [100, 20];

      // Branch Group
      win.pnlOp.grpBranch = win.pnlOp.add('group');
      win.pnlOp.grpBranch.orientation = 'row';
      win.pnlOp.grpBranch.stx = win.pnlOp.grpBranch.add('statictext', undefined,'Branch:');
      win.pnlOp.grpBranch.stx.minimumSize = [60, 20];
      var arrBranch = ['Glasgow', 'Leeds', 'London', 'Manchester'];
      var ss;
      win.pnlOp.grpBranch.ddl = win.pnlOp.grpBranch.add('dropdownlist', undefined,  arrBranch);
      win.pnlOp.grpBranch.ddl.minimumSize = [100, 20];
      win.pnlOp.okk =win.pnlOp.add('button',undefined,'OK');
      win.pnlOp.cancel = win.pnlOp.add('button',undefined,'CANCEL');

      var intResult = win.show();

       

      // THIS how can i access the selected items please suggest anyone.
      if(win.pnlOp.grpBranch.ddl.selectedIndex ==0){
          alert ("true");
          }
      else{
          alert ("false");
          }