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

    Value of Multiselect radio button

      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

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

          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
            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
              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 :
                  l_arr APEX_APPLICATION_GLOBAL.VC_ARR2;
                  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;
              Maybe you can simply use INSTR function depending on your values :
              SELECT *
              FROM YOUR_TABLE
              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.

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

                APEX_UTIL.PREPARE_URL does not work across workspaces?

                hope this helps,

                Migrate Database to ASM using RMAN
                Set DISPLAY variable & Enable access control