4 Replies Latest reply: Jun 28, 2012 7:03 PM by Satishbabu Gunukula RSS

    Value of Multiselect radio button

    Maoro
      hello
      i have a form that is built based on table named "Request"
      there is one filed in the table named "Attachments" of data type varchar2(100)
      when a client is filling the request there is a multiselect check box button that allow the client to select multiple value, and these value are static meaning defined within the multiselect button and not based on a table

      when the client fill the request form and select multiple value for attachments and hit save , an error is returned
      please note that when the mutiselect button was a simple input textfield there was no problem
      your help is appreciated
      thanks

      Edited by: Maoro on Jun 27, 2012 6:44 AM
        • 1. Re: Value of Multiselect radio button
          Yann39
          Hi,

          a multiselect radio button ? You mean users can select multiple values from your radio group item ? I cannot find this kind of item in apex.
          Maybe you should use checkboxes.

          If you are passing selected value using item substitution string :YOUR_ITEM, it should not be different from a select list or a textfield, in case a single value is returned. If you are getting several values (i.e. checkboxes), maybe you should take a look at APEX_UTIL.STRING_TO_TABLE and TABLE_TO_STRING functions.
          If you are using JavaScript somewhere, you have to use +$v('YOUR_ITEM')+.

          Maybe you can share some code.
          • 2. Re: Value of Multiselect radio button
            Maoro
            Yes it is a mutiselect checkbox, can you please elaborate more on how and where to use the above function apex_util,,,,thank you
            • 3. Re: Value of Multiselect radio button
              Yann39
              When you are referencing a checkbox item (using *:YOUR_ITEM* substitution string or *$v('YOUR_ITEM')* in JavaScript), you get a ':' separated list of selected values.
              So depending on what you want to do with it, in PL/SQL you may have to use APEX_UTIL.STRING_TO_TABLE to get each values. Take a look at the documentation.

              So in your function, you should have something like :
              DECLARE
                  l_arr APEX_APPLICATION_GLOBAL.VC_ARR2;
              BEGIN
                  l_arr := APEX_UTIL.STRING_TO_TABLE(:YOUR_ITEM);
                  FOR i IN 1..l_arr.count LOOP
                      // do something using l_arr(i) here
                  END LOOP;
              END;
              Maybe you can simply use INSTR function depending on your values :
              SELECT *
              FROM YOUR_TABLE
              WHERE INSTR(:YOUR_ITEM,YOUR_VALUE) > 0
              but be aware that it could give wrong results if you have values that may be contained in others.
              Example: INSTR('B:AC:BD','A') will return 3 but 'A' is not a valid value from your list.

              Good luck.

              Yann.
              • 4. Re: Value of Multiselect radio button
                Satishbabu Gunukula
                please check below links

                APEX_UTIL.PREPARE_URL does not work across workspaces?
                http://docs.oracle.com/cd/E14373_01/apirefs.32/e13369/apex_util.htm

                hope this helps,

                regards
                http://www.oracleracexpert.com
                Migrate Database to ASM using RMAN
                http://www.oracleracexpert.com/2009/10/migrate-database-to-asm-using-rman.html
                Set DISPLAY variable & Enable access control
                http://www.oracleracexpert.com/2009/12/set-display-variable-enable-access.html