3 Replies Latest reply: Jun 28, 2012 11:40 AM by Jeff E RSS

    tabular form select list validation

    944612
      Hi,

      i have the following problem with my tabular form:
      - I only want that a select list entry get selected ones not several times. It must be a validation check. Is there any example available?
      I only found this idea from Denes: http://apex.oracle.com/pls/otn/f?p=31517:41:1747072107299301::NO
      I could create an validation like this but I wonder if there is an easier way?
      - If a selectlist value is already set within a row then this id should not be displayed in any other row.
      I though about something like this in my lov:
      -- Column FACILITY_ID
      -- LOV:
      select description display_value, ID return_value 
      from FACILITY
      where id not in 
               (select fk_facility_id
                from orders)
      or id = #FACILITY_ID#
      order by 1
      But it doesn't work. So what I need is a dynamic select list based on the row value.
        • 1. Re: tabular form select list validation
          944612
          One solution for my first issue: "I only want that a select list entry get selected ones not several times. It must be a validation check. Is there any example available?"
          -- Validation of Type: Function Returning Error Text 
          
          DECLARE
             l_facility_ids varchar2(32000);
             l_facility_bez varchar2(200);
             l_error   VARCHAR2 (4000);
          BEGIN
             FOR i IN 1 .. apex_application.g_f07.COUNT -- select list with facilities
             LOOP
                IF instr(':'||l_facility_ids||':',':'||apex_application.g_f07(i)||':')>0
                THEN 
                   select description into l_facility_bez from facilities where id = apex_application.g_f07(i);
                
                   l_error :=
                         l_error
                      || '</br>'
                      || 'Row '
                      || i
                      || ': facility"' || l_facility_bez  ||'" is already selected.'; 
                END IF;
                
                l_facility_ids := l_facility_ids ||':'|| apex_application.g_f07(i);
             END LOOP;
          
             RETURN LTRIM (l_error, '</br>');
          END;
          Still second question is not answered: "If a selectlist value is already set within a row then this id should not be displayed in any other row."
          • 2. Re: tabular form select list validation
            Jeff E
            Look into adding functionality of applying a cascading select list to all rows of the tabular form.

            This thread likes similar to your question: Cascading select list in tabular form

            Particularly vee's example: http://apex.oracle.com/pls/apex/f?p=18:307
            • 3. Re: tabular form select list validation
              Jeff E
              Look into adding functionality of applying a cascading select list to all rows of the tabular form.

              This thread likes similar to your question: Cascading select list in tabular form

              Particularly vee's example: http://apex.oracle.com/pls/apex/f?p=18:307