1 Reply Latest reply on Jul 9, 2009 10:21 AM by Thomas B. Nielsen

    ID-CS4 - Window UI based Check Box control - Reg.

    Adobe-InDesign CS4 Level 1

      Dear All

       

         I'm having one big doubt in Window based Check Box Control..

       

      Here I create the below script using Window class.

       

      var myDlg = new Window('dialog', 'MXP -- Final Filter');
      myDlg.orientation = 'column';
      myDlg.panel1=myDlg.add('panel',[0,0,290,45],Checking_Methods');
      myDlg.label1=myDlg.panel1.add("statictext",[10,15,120,120],"Font_Checking");
      myDlg.panel1.chkOne = myDlg.panel1.add("checkbox", [140,15,270,30], "Font_check",{staticLabel:"1", checkedState:false});

      myDlg.panel3=myDlg.add('panel',[10,10,300,55],undefined);
      myDlg.panel3.buildBtn = myDlg.panel3.add('button', [45,5,110,40], 'Build',{name:'ok'});


      myDlg.panel3.buildBtn.onClick = fun;

      myDlg.show();

      function fun()
      {
      // Here I checked the myDlg.panel1.chkOne.checkState....

       

      }

      //------------------------------------------------- End ---------------------------------------------//

       

      I can't get the correct answer,

      for example while I'm using the Checkbox [ON MODE] - [Check State= true] - the result is null

      @ the same time Checkbox [OFF MODE] - [Check State= false] - the result is null....

       

      Please anybody can kindly help me, for solving the above problem.....

       

      Problem is:

       

      (*) First Check Box - CheckState is False

      (*) When I'm select the "Check Box" and used Button "OK" then Show the message is "True"

      (*) If Suppose I'm not Select the "Check Box" and used the Button "OK" then show the message is "False"

      (*) This will generate by Window Based Script UI to create...

       

      Please any one can help me then I will be appriciate ................

       

      Thanks & Regards

      T.R.Harihara SudhaN

        • 1. Re: ID-CS4 - Window UI based Check Box control - Reg.
          Thomas B. Nielsen Level 3

          If you look at the Script UI in the OMV under checkbox, you want find a checkedState, but you can find a "value".

          (Update: I dont have CS4 here right now, so the above and below atleast is true in CS3)

          so:

           

          var myDlg = new Window('dialog', 'MXP -- Final Filter');
          myDlg.orientation = 'column';
          myDlg.panel1=myDlg.add('panel',[0,0,290,45],"Checking_Methods");
          myDlg.label1=myDlg.panel1.add("statictext",[10,15,120,120],"Font_Checking");
          myDlg.panel1.chkOne = myDlg.panel1.add("checkbox", [140,15,270,30], "Font_check",{staticLabel:"1", checkedState:false});

           

          myDlg.panel3=myDlg.add('panel',[10,10,300,55],undefined);
          myDlg.panel3.buildBtn = myDlg.panel3.add('button', [45,5,110,40], 'Build',{name:'ok'});
          myDlg.panel3.buildBtn.onClick = fun;

           

          myDlg.show();

           

          function fun() {
              // Here I checked the myDlg.panel1.chkOne.checkState.... (no such thing, use .value)

               alert(myDlg.panel1.chkOne.value);
          }

           

          Message was edited by: Thomas B. Nielsen