5 Replies Latest reply: Jan 17, 2013 7:57 AM by 983316 RSS

    Disable Single CheckBox

    983316
      Hello,

      I have an application where I want to disable a checkBoxe for a single row according to a specific condition. How can I do that ?

      Thank in advance !
        • 1. Re: Disable Single CheckBox
          riedelme
          980313 wrote:
          Hello,

          I have an application where I want to disable a checkBoxe for a single row according to a specific condition. How can I do that ?

          Thank in advance !
          What version of Apex?

          Do you want to disable it and leave it in place (and unclickable) or can you use a condition to make it not appear at all (similar effect though silightly different)?

          Did you look at dynamic actions if your version supports them?

          Edited by: riedelme on Jan 9, 2013 8:16 AM
          • 2. Re: Disable Single CheckBox
            Ramesh P, Oracle APEX Developer
            Look working example her:

            https://apex.oracle.com/pls/apex/f?p=60685:2

            For example if you want to disable a checkbox option, lets say you have a checkbox options
            Test1 - 1
            Test2 - 2
            Test3 - 3
            Test4 - 4
            Lets say you want to disable option 3 (Test3 - 3)
            Check for the Checkbox name from the firebug console (something like p_v01 here in this page).
            Make sure you are passing the value of the checkbox option to be disabled which is chKOption
            If you want to get value from a page item on page load use chkOption = '&P2_CHK_OPTION_VALUE.'

            <script type ="text/javascript">
            function disableCheckBox(pOption){
                 var nameArray = $("input[name=p_v01]").map(function(){
                                          return this.getAttribute('value');
                                     }).get();
                 for (i=0;i<nameArray.length;i++){
                      if(pOption == nameArray){               
                           $("#P2_CHECK1_"+i).attr("disabled", true);
                      }
                 }
            }
            $(document).ready(function(){
                 var chkOption = 3;
                 disableCheckBox(chkOption);
            });     
            </script>


            Thanks,
            Naidu789

            If you think, I have answered your question, please mark it as answered.
            • 3. Re: Disable Single CheckBox
              983316
              actually, I discovered that I should not disable the Checkboxes, I have to leave the option to the user in case he wants to change his choice, but I couldn't use the Apex_item.checkBox because I have to retrieve the date from more than one table. So, what I want to do now is:
              1-retrieve data from more than one table,
              2-give the choice to user to check or uncheck any row in the table
              3- the check and uncheck processes must be updated in one of the tables that are retrieved in the form. Do you have any idea that can help me do these tasks.

              I am using Oracle Database 10g Express Edition Release 10.2.0.1.0 -
              • 4. Re: Disable Single CheckBox
                Vivek Ananda
                980313

                Let me try to understand you requirement

                You have sql report that fetches data from multiple tables, once the data is fetch you want to give the use an option to check some rows. Once the user presses a button, you want a table to be updated for all the rows that are marked checked ?

                Vivek
                • 5. Re: Disable Single CheckBox
                  983316
                  Yes, that's what I am trying to do Vivek Ananda.