7 Replies Latest reply on Jun 2, 2009 3:39 AM by Harbs.

    enable dialog object

    RockScript

      i have two radio button(singlepage ps, selectedpage ps). i want to enable the dialog object(CSV file selectif i select second radio button(selectedpage ps)

       

      only. if i select fist radio button(singlepage ps) . i dont want to enable dialog obje. could anyone tell me. Below i attach the output.

        • 1. Re: enable dialog object
          Thomas B. Nielsen Level 3

          Is this what you are attempting to do?

           

          var dlg = new Window('dialog', 'Active buttons');
          dlg.btnPnl = dlg.add('panel', undefined, 'Build it');
          dlg.btnPnl.testBtn = dlg.btnPnl.add('button', undefined, 'Test');
          dlg.btnPnl.testBtn.enabled = false;
          dlg.btnPnl.testBtn.onClick = myalert;

           

          dlg.btnPnl.alignLeftRb = dlg.btnPnl.add('radiobutton', undefined, 'Left');
          dlg.btnPnl.alignLeftRb.onClick = myLeftAlert;
          dlg.btnPnl.alignLeftRb.value = true;

           

          dlg.btnPnl.alignRightRb = dlg.btnPnl.add('radiobutton', undefined, 'Right');
          dlg.btnPnl.alignRightRb.onClick = myRightAlert;

           

          dlg.show();

           

          function myalert() {
              alert('Test button clicked');
          }

           

          function myLeftAlert() {
              alert('Radio left');
              dlg.btnPnl.testBtn.enabled = false;
          }

           

          function myRightAlert() {
              alert('Radio right');
              dlg.btnPnl.testBtn.enabled = true;
          }

           

          --

          Thomas B. Nielsen

          http://www.nobrainer.dk

          • 3. hide button object
            RockScript Level 1

            Hi niel,

             

            i have one doube. i want to hide the button when i click radio button . isit possible. How to hide buttton. could you tell me.

            • 4. Re: hide button object
              Thomas B. Nielsen Level 3

              This should do the trick (please set the question to answered):

               

              var dlg = new Window('dialog', 'Active buttons');
              dlg.btnPnl = dlg.add('panel', undefined, 'Build it');
              dlg.btnPnl.testBtn = dlg.btnPnl.add('button', undefined, 'Test');

               

              dlg.btnPnl.testBtn.visible = false;
              dlg.btnPnl.testBtn.onClick = myalert;

               

              dlg.btnPnl.alignLeftRb = dlg.btnPnl.add('radiobutton', undefined, 'Left');
              dlg.btnPnl.alignLeftRb.onClick = myLeftAlert;
              dlg.btnPnl.alignLeftRb.value = true;

               

              dlg.btnPnl.alignRightRb = dlg.btnPnl.add('radiobutton', undefined, 'Right');
              dlg.btnPnl.alignRightRb.onClick = myRightAlert;

               

              dlg.show();
              function myalert() {
                   alert('Test button clicked');
              }

               

              function myLeftAlert() {
                    //alert('Radio left');
                    dlg.btnPnl.testBtn.visible = false;
              }

               

              function myRightAlert() {
                   //alert('Radio right');
                    dlg.btnPnl.testBtn.visible = true;
              }

              1 person found this helpful
              • 5. Re: enable dialog object
                Harbs. Level 6

                button.visible = false;

                 

                Harbs

                1 person found this helpful
                • 6. Re: enable dialog object
                  RockScript Level 1

                  Thank you Harbs

                  • 7. Re: hide button object
                    RockScript Level 1

                    Thank you Niels.