11 Replies Latest reply: Jul 27, 2011 1:25 PM by 869706 RSS

    Checkboxes Issue

    869706
      Hello,

      I applicate the event onClick="alert('test');" in my checkbox, but doesn't works. I write in the Column Attributes on Element Attributes.

      Thanks
        • 1. Re: Checkboxes Issue
          755494
          Hi Raul,

          onclick property is not there for checkbox

          Please refer to [ http://www.w3schools.com/jsref/dom_obj_checkbox.asp|http://www.w3schools.com/jsref/dom_obj_checkbox.asp]

          Please refre to [ http://dgielis.blogspot.com/2008/02/checkbox-in-apex.html| http://dgielis.blogspot.com/2008/02/checkbox-in-apex.html] also


          Thanks & Regards,
          Vikas Krishna
          • 2. Re: Checkboxes Issue
            869706
            Hi Vikas and thank you for the reply,

            Well, I altered a column for my report to Simple Check Box, the column returns 'S' or 'N' but when I created which event for the check box, I have not sucess, I check in the source code of the page and I found this:
            input type="checkbox" name="f14_NOSUBMIT" value=""  id="f14_0000_01" onClick="if (this.checked) {apex.jQuery('#f14_0000').val('');} else {apex.jQuery('#f14_0000').val('');}" />
            I can't remove this? I think that is because this I have a problem with the events of the checkbox.

            Thank you!
            • 3. Re: Checkboxes Issue
              755494
              You might consider using apex_item.checkbox in the report query

              Please see the implementation of check box in Tabular report in Denes's demo application

              [http://apex.oracle.com/pls/otn/f?p=31517:170:2761023435133266|http://apex.oracle.com/pls/otn/f?p=31517:170:2761023435133266]


              Thanks & Regards,
              Vikas Krishna
              • 4. Re: Checkboxes Issue
                fac586
                Vikas Krishna erroneously wrote:

                onclick property is not there for checkbox
                Please try reading for comprehension:
                >
                The Checkbox object also supports the standard properties, methods, and events.
                >
                Standard events including <tt>onclick</tt>.
                • 5. Re: Checkboxes Issue
                  755494
                  My apologies. I was wrong there.
                  • 6. Re: Checkboxes Issue
                    869706
                    Thank you Vikas for the reply and Fac586 for the helpful answer.

                    I think that I got it now, I'll try and if I have any question about it I'll write here. Thank you guys.

                    Regards
                    Raul Welter
                    • 7. Re: Checkboxes Issue
                      869706
                      Well, now I have another problem, do not appears the checkbox item, but the code, like
                      <input type="checkbox" name="f30" value="1" onclick="If this.checked { test(); } else { test2(); }" id="f30_1" />
                      My code for the report is
                      select 
                      "ID" ID_DISPLAY,
                      "PRODUTO_CODIGO",
                      "COMPLEMENTO",
                      apex_item.checkbox (30,
                                                 '#ROWNUM#',
                                                 'onclick="If this.checked { test(); } else { test2(); }"',
                                                 NULL,
                                                 ':',
                                                 'f30_' || '#ROWNUM#'
                                                ) SELECIONADO,
                      "QTD",
                      "UM_SIGLA",
                      from "PROPOSTA_ESPEC_GTB_ATM"
                      where COMPONENTE_ID = :P25_COMPONENTE_ID
                      I have another question, what is the '30', 'NULL', ':', 'f_30' attributes for the apex_item.checkbox?

                      Can I write like this:
                      DECODE (SELECIONADO,
                                    'S',
                                    '<input type="checkbox" name="f30" value="1" id="f30_1" />'
                                    '<input type="checkbox" name="f30" value="0" id="f30_1" />'); 
                      and the onClick event I could write in the element column attribute?

                      Thanks & Regards
                      Raul Welter

                      Edited by: RaulWelter on 27/07/2011 08:15

                      Edited by: RaulWelter on 27/07/2011 08:15
                      • 8. Re: Checkboxes Issue
                        869706
                        Hi,

                        I sold my problem with the checkbox, changing for an icon item.
                        But the problem is pratically the same:

                        I have a problem with a onClick event in my image.
                        I created a report with a decode for my column, if the column is 'S' then I insert an icon with the correct simbol, else I insert an icon with the wrong simbol.
                        For which image I have created an onClick event like this:

                        onClick="test(#ID#);"

                        Well, I don't know if the code is right or not, but I want to pass to the javascript function, the column ID reffering the current row.
                        Any replies is be accept.

                        Thanks & Regards
                        Raul Welter
                        • 9. Re: Checkboxes Issue
                          Kiran Pawar
                          Hi Raul,

                          >
                          I have another question, what is the '30', 'NULL', ':', 'f_30' attributes for the apex_item.checkbox?
                          >
                          Please refer this:

                          http://download.oracle.com/docs/cd/E17556_01/doc/apirefs.40/e15519/apex_item.htm#CHDDCHAF

                          Regards,
                          Kiran
                          • 10. Re: Checkboxes Issue
                            869706
                            Hi Kiran, thank you for the reply.

                            I have read it and I got it, but I have just a little doubt with the events again.
                            I created a function that validate if my checkboxes is checked or not, I want to even my page load, this function start it, but I created for just one row for my report and I know that exists a function or a command line that verificate it row per row, like while or each functions. I don't know how write this, can you help me?

                            Thanks & Regards

                            Raul Welter
                            • 11. Re: Checkboxes Issue
                              869706
                              Thank you for all the replies, helpfus and corrects answers!
                              I have solded my question.

                              Congratulations APEX Team!

                              Thanks & Regards
                              Raul Welter