4 Replies Latest reply on Mar 14, 2019 10:30 AM by Franck N

    need to send column value from javascript call from <a href

    ReemaPuri

      hi

       

      WORKSPACE :-REEMAPU

      name :-test

      password :- Test@12345

      https://apex.oracle.com/pls/apex/f?p=37669:8:3181392112722:::::

       

      SELECT CASE

                WHEN deleted_restored is null   or deleted_restored ='RESTORED' THEN

                 '<a href="#" onclick="deleteRow(''#CODE#'');return false;">

         <img src="#APP_IMAGES#delete.png" width="30px" height="30px"></a>'

                ELSE

                 NULL

             END  AS DELETE1,

      DELETED_RESTORED,CODE

             ,NAME FROM EMP;

       

       

      i wanted to send the value  of column code in apex item P8_DELETED_ID  from column name deleted1

       

      and javascript code is

       

      function deleteRow(value){

          if (confirm('Would you like to delete this row?')) {

              // Delete it!

              apex.item('P8_DELETE_ID').setValue(value);

              apex.event.trigger('#P8_DELETE_ID', 'Link_Call', '');

          } else {

              // Do nothing!

          }

      }

       

       

       

      now the value going is #CODE#  but it should be selected value like 1 or 2  or 3

      how to send the column value in a href in javascript function

        • 1. Re: need to send column value from javascript call from <a href
          fac586

          ReemaPuri wrote:

           

          hi

           

          WORKSPACE :-REEMAPU

          name :-test

          password :- Test@12345

          https://apex.oracle.com/pls/apex/f?p=37669:8:3181392112722:::::

           

          SELECT CASE

          WHEN deleted_restored is null or deleted_restored ='RESTORED' THEN

          '<a href="#" onclick="deleteRow(''#CODE#'');return false;">

          <img src="#APP_IMAGES#delete.png" width="30px" height="30px"></a>'

          ELSE

          NULL

          END AS DELETE1,

          DELETED_RESTORED,CODE

          ,NAME FROM EMP;

           

           

          i wanted to send the value of column code in apex item P8_DELETED_ID from column name deleted1

           

          and javascript code is

           

          function deleteRow(value){

          if (confirm('Would you like to delete this row?')) {

          // Delete it!

          apex.item('P8_DELETE_ID').setValue(value);

          apex.event.trigger('#P8_DELETE_ID', 'Link_Call', '');

          } else {

          // Do nothing!

          }

          }

           

           

           

          now the value going is #CODE# but it should be selected value like 1 or 2 or 3

          how to send the column value in a href in javascript function

          Interactive Grid column values are referenced using &COLUMN_ALIAS. substitution syntax, not #COLUMN_ALIAS#.

          1 person found this helpful
          • 2. Re: need to send column value from javascript call from <a href
            ReemaPuri

            onclick="deleteRow(''&CODE.'');return false;">

             

            OR onclick="deleteRow(&CODE.);return false;">

             

            still it is showing  null no value is populating

            • 3. Re: need to send column value from javascript call from <a href
              Franck N

              Hi,

               

              check page 12 on your APP:

              https://apex.oracle.com/pls/apex/f?p=37669:12:10397216917189:::::

               

              It should do the trick.

              what did i changed:

               

              your Pl /SQL as bellow:

               

              SELECT CASE
                     WHEN deleted_restored is null   or deleted_restored ='RESTORED' THEN
                         '<a href="#" onclick="deleteRow('||CODE||');return false;">
                         <img src="#APP_IMAGES#delete.png" WIDTH="30px" height="30px"></a>'
                        ELSE
                         NULL
                     END  AS DELETE1,
                    DELETED_RESTORED,
                    CODE,
                    CODE as TEST,---this is for my test to check the id  Value! can be deleted
                    NAME
               FROM EMP;
              

               

               

              and your JQuery function as bellow:

               

              function deleteRow(value)
                  //set value
                  var a = apex.item('P12_DELETE_ID').setValue(value);
                  //get value
                  var b = $v("P12_DELETE_ID");
                  //convert to number
                  var c = parseInt(b);
                  if (confirm('Would you like to delete this row? ' +' code =' + c )) { //fro testing purposes i ma displaying the selected  CODE Value in the alert message
                      // Delete it!
                      //apex.item('P8_DELETE_ID').setValue(value);
                      apex.event.trigger(c, 'Link_Call', '');
                  } else {
                      // Do nothing!
                  }
              }
              

              Code is documentation enough!  with the comments you will understand what i did there.

               

              regards,

              Franck