4 Replies Latest reply on Jan 18, 2013 5:02 PM by Suma001

    Adding quotations to the string in javascript method (using APEX_ITEM)

    Suma001
       
        • 1. Re: Adding quotations to the string in javascript method (using APEX_ITEM)
          Suma001
          Hi All,

          I am using APEX 4.1, in the interactive report I was using following syntax

          APEX_ITEM.DISPLAY_AND_SAVE
          (3,
          COLUMN,
          'd'||ROWNUM,'') || '<label for="add' ||ROWNUM || '"><input type=button id="add' ||ROWNUM || '" onclick="javascript:add(d' ||ROWNUM|| ',''||ACTIVE_YN||');" value="add"></label>' "COLUMN"

          Here my java script is giving error saying ACTIVE_YN value is not defined, when I tried putting quotations around it using firebug it works.

          Anyone know how to add quotations around the column using this syntax, I have tried few combinations adding "", '#ACTIVE_YN#', '&', .......etc nothing worked.

          Edited by: Suma001 on Jan 17, 2013 7:03 AM
          • 2. Re: Adding quotations to the string in javascript method (using APEX_ITEM)
            VC
            Suma001 wrote:
            Hi All,

            I am using APEX 4.1, in the interactive report I was using following syntax

            APEX_ITEM.DISPLAY_AND_SAVE
            (3,
            COLUMN,
            'd'||ROWNUM,'') || '<label for="add' ||ROWNUM || '"><input type=button id="add' ||ROWNUM || '" onclick="javascript:add(d' ||ROWNUM|| ',''||ACTIVE_YN||');" value="add"></label>' "COLUMN"

            Here my java script is giving error saying ACTIVE_YN value is not defined, when I tried putting quotations around it using firebug it works.

            Anyone know how to add quotations around the column using this syntax, I have tried few combinations adding "", '#ACTIVE_YN#', '&', .......etc nothing worked.

            Edited by: Suma001 on Jan 17, 2013 7:03 AM
            try this
             onclick="javascript:add(d' ||ROWNUM|| ','''||ACTIVE_YN||''');" value="add"></label>' "COLUMN"
            //notice the 3 single quotes around the active_yn column
            Cheers,
            Vikram
            • 3. Re: Adding quotations to the string in javascript method (using APEX_ITEM)
              Suma001
              Thanks for quick reply Vikram, it worked :)
              • 4. Re: Adding quotations to the string in javascript method (using APEX_ITEM)
                Suma001
                I have one more question, I was trying to pass ROWNUM to the javascript in Interactive report selecting target as URL.

                javascript:approve('||ROWNUM||','#ACTIVE_YN#'), I have tried in different ways (giving #, three quotes, double quotes ...etc) its not creating rownum.

                any idea on this?

                Thanks.