Get the values of the selected rows with checked checkbox





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















Having a report of the services table with checkbox for each row, I am trying to get the values of the selected service, so that when I click on next I can create a report with the services chosen in the new page.



I have tried in this way:



Report of the services table.



select code,
name,
cost,
apex_item.hidden(p_idx => 1,
p_value => code) ||
apex_item.hidden(p_idx => 2,
p_value => cost) ||
apex_item.checkbox2(p_idx => 3,
p_value => code) CheckBox
from services


enter image description here



I created a process.



Source:



begin
apex_collection.CREATE_OR_TRUNCATE_COLLECTION ('SDBA_ORDER_ITEMS1');

for i in 1..apex_application.g_f01.count loop
apex_collection.add_member(
p_collection_name => 'SDBA_ORDER_ITEMS1',
p_c001 => to_number(apex_application.g_f01(i)), -- service_code
p_c002 => to_number(apex_application.g_f02(i)), -- cost
p_c003 => to_number(apex_application.g_f03(i)) -- service_code
);
end loop;
end;


Server-side Condition:



begin
for i in 1..apex_application.g_f01.count loop
for j in 1..apex_application.g_f03.count loop
if apex_application.g_f01(i) = apex_application.g_f03(j) then
return true;
else
return false;
end if;
end loop;
end loop;
end;

Report on the next page.

select (select name from services where code = c001) as service_name,
c002 as cost
from apex_collections
where collection_name = 'SDBA_ORDER_ITEMS1'
order by 1


Report on the next page.



select (select name from services where code = c001) as service_name,
c002 as cost
from apex_collections
where collection_name = 'SDBA_ORDER_ITEMS1'
order by 1


In this report it shows all the services of the table instead of the selected ones.



How can I get only the selected rows? Can anybody help me please?



Thanks in advance.










share|improve this question































    0















    Having a report of the services table with checkbox for each row, I am trying to get the values of the selected service, so that when I click on next I can create a report with the services chosen in the new page.



    I have tried in this way:



    Report of the services table.



    select code,
    name,
    cost,
    apex_item.hidden(p_idx => 1,
    p_value => code) ||
    apex_item.hidden(p_idx => 2,
    p_value => cost) ||
    apex_item.checkbox2(p_idx => 3,
    p_value => code) CheckBox
    from services


    enter image description here



    I created a process.



    Source:



    begin
    apex_collection.CREATE_OR_TRUNCATE_COLLECTION ('SDBA_ORDER_ITEMS1');

    for i in 1..apex_application.g_f01.count loop
    apex_collection.add_member(
    p_collection_name => 'SDBA_ORDER_ITEMS1',
    p_c001 => to_number(apex_application.g_f01(i)), -- service_code
    p_c002 => to_number(apex_application.g_f02(i)), -- cost
    p_c003 => to_number(apex_application.g_f03(i)) -- service_code
    );
    end loop;
    end;


    Server-side Condition:



    begin
    for i in 1..apex_application.g_f01.count loop
    for j in 1..apex_application.g_f03.count loop
    if apex_application.g_f01(i) = apex_application.g_f03(j) then
    return true;
    else
    return false;
    end if;
    end loop;
    end loop;
    end;

    Report on the next page.

    select (select name from services where code = c001) as service_name,
    c002 as cost
    from apex_collections
    where collection_name = 'SDBA_ORDER_ITEMS1'
    order by 1


    Report on the next page.



    select (select name from services where code = c001) as service_name,
    c002 as cost
    from apex_collections
    where collection_name = 'SDBA_ORDER_ITEMS1'
    order by 1


    In this report it shows all the services of the table instead of the selected ones.



    How can I get only the selected rows? Can anybody help me please?



    Thanks in advance.










    share|improve this question



























      0












      0








      0








      Having a report of the services table with checkbox for each row, I am trying to get the values of the selected service, so that when I click on next I can create a report with the services chosen in the new page.



      I have tried in this way:



      Report of the services table.



      select code,
      name,
      cost,
      apex_item.hidden(p_idx => 1,
      p_value => code) ||
      apex_item.hidden(p_idx => 2,
      p_value => cost) ||
      apex_item.checkbox2(p_idx => 3,
      p_value => code) CheckBox
      from services


      enter image description here



      I created a process.



      Source:



      begin
      apex_collection.CREATE_OR_TRUNCATE_COLLECTION ('SDBA_ORDER_ITEMS1');

      for i in 1..apex_application.g_f01.count loop
      apex_collection.add_member(
      p_collection_name => 'SDBA_ORDER_ITEMS1',
      p_c001 => to_number(apex_application.g_f01(i)), -- service_code
      p_c002 => to_number(apex_application.g_f02(i)), -- cost
      p_c003 => to_number(apex_application.g_f03(i)) -- service_code
      );
      end loop;
      end;


      Server-side Condition:



      begin
      for i in 1..apex_application.g_f01.count loop
      for j in 1..apex_application.g_f03.count loop
      if apex_application.g_f01(i) = apex_application.g_f03(j) then
      return true;
      else
      return false;
      end if;
      end loop;
      end loop;
      end;

      Report on the next page.

      select (select name from services where code = c001) as service_name,
      c002 as cost
      from apex_collections
      where collection_name = 'SDBA_ORDER_ITEMS1'
      order by 1


      Report on the next page.



      select (select name from services where code = c001) as service_name,
      c002 as cost
      from apex_collections
      where collection_name = 'SDBA_ORDER_ITEMS1'
      order by 1


      In this report it shows all the services of the table instead of the selected ones.



      How can I get only the selected rows? Can anybody help me please?



      Thanks in advance.










      share|improve this question
















      Having a report of the services table with checkbox for each row, I am trying to get the values of the selected service, so that when I click on next I can create a report with the services chosen in the new page.



      I have tried in this way:



      Report of the services table.



      select code,
      name,
      cost,
      apex_item.hidden(p_idx => 1,
      p_value => code) ||
      apex_item.hidden(p_idx => 2,
      p_value => cost) ||
      apex_item.checkbox2(p_idx => 3,
      p_value => code) CheckBox
      from services


      enter image description here



      I created a process.



      Source:



      begin
      apex_collection.CREATE_OR_TRUNCATE_COLLECTION ('SDBA_ORDER_ITEMS1');

      for i in 1..apex_application.g_f01.count loop
      apex_collection.add_member(
      p_collection_name => 'SDBA_ORDER_ITEMS1',
      p_c001 => to_number(apex_application.g_f01(i)), -- service_code
      p_c002 => to_number(apex_application.g_f02(i)), -- cost
      p_c003 => to_number(apex_application.g_f03(i)) -- service_code
      );
      end loop;
      end;


      Server-side Condition:



      begin
      for i in 1..apex_application.g_f01.count loop
      for j in 1..apex_application.g_f03.count loop
      if apex_application.g_f01(i) = apex_application.g_f03(j) then
      return true;
      else
      return false;
      end if;
      end loop;
      end loop;
      end;

      Report on the next page.

      select (select name from services where code = c001) as service_name,
      c002 as cost
      from apex_collections
      where collection_name = 'SDBA_ORDER_ITEMS1'
      order by 1


      Report on the next page.



      select (select name from services where code = c001) as service_name,
      c002 as cost
      from apex_collections
      where collection_name = 'SDBA_ORDER_ITEMS1'
      order by 1


      In this report it shows all the services of the table instead of the selected ones.



      How can I get only the selected rows? Can anybody help me please?



      Thanks in advance.







      oracle-apex






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 25 '18 at 10:12







      Neon

















      asked Nov 25 '18 at 0:05









      NeonNeon

      1208




      1208
























          1 Answer
          1






          active

          oldest

          votes


















          0














          Checkboxes are formed into dense collections, not potentially sparse like the other item types. I think this is a product of web tech, not APEX.



          So if you had ID, Name, Checkbox



          1 - ada - checked
          2 - charles - not checked
          3 - alan - checked


          There would be 3 index elements in ID and Names array, and only 2 in the checkbox array - and index element 3 would be empty.



          So you need to match checkbox existence by indexing by the code value, and checking for existence more like



          apex_application.g_f03(apex_application.g_f01.code)


          While taking care of potential no_data_found






          share|improve this answer
























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53463520%2fget-the-values-of-the-selected-rows-with-checked-checkbox%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Checkboxes are formed into dense collections, not potentially sparse like the other item types. I think this is a product of web tech, not APEX.



            So if you had ID, Name, Checkbox



            1 - ada - checked
            2 - charles - not checked
            3 - alan - checked


            There would be 3 index elements in ID and Names array, and only 2 in the checkbox array - and index element 3 would be empty.



            So you need to match checkbox existence by indexing by the code value, and checking for existence more like



            apex_application.g_f03(apex_application.g_f01.code)


            While taking care of potential no_data_found






            share|improve this answer




























              0














              Checkboxes are formed into dense collections, not potentially sparse like the other item types. I think this is a product of web tech, not APEX.



              So if you had ID, Name, Checkbox



              1 - ada - checked
              2 - charles - not checked
              3 - alan - checked


              There would be 3 index elements in ID and Names array, and only 2 in the checkbox array - and index element 3 would be empty.



              So you need to match checkbox existence by indexing by the code value, and checking for existence more like



              apex_application.g_f03(apex_application.g_f01.code)


              While taking care of potential no_data_found






              share|improve this answer


























                0












                0








                0







                Checkboxes are formed into dense collections, not potentially sparse like the other item types. I think this is a product of web tech, not APEX.



                So if you had ID, Name, Checkbox



                1 - ada - checked
                2 - charles - not checked
                3 - alan - checked


                There would be 3 index elements in ID and Names array, and only 2 in the checkbox array - and index element 3 would be empty.



                So you need to match checkbox existence by indexing by the code value, and checking for existence more like



                apex_application.g_f03(apex_application.g_f01.code)


                While taking care of potential no_data_found






                share|improve this answer













                Checkboxes are formed into dense collections, not potentially sparse like the other item types. I think this is a product of web tech, not APEX.



                So if you had ID, Name, Checkbox



                1 - ada - checked
                2 - charles - not checked
                3 - alan - checked


                There would be 3 index elements in ID and Names array, and only 2 in the checkbox array - and index element 3 would be empty.



                So you need to match checkbox existence by indexing by the code value, and checking for existence more like



                apex_application.g_f03(apex_application.g_f01.code)


                While taking care of potential no_data_found







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 26 '18 at 0:27









                ScottScott

                2,12411422




                2,12411422
































                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53463520%2fget-the-values-of-the-selected-rows-with-checked-checkbox%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    這個網誌中的熱門文章

                    Tangent Lines Diagram Along Smooth Curve

                    Yusuf al-Mu'taman ibn Hud

                    Zucchini