4 Replies Latest reply: Nov 17, 2012 3:02 AM by Mindmap RSS

    Conditional list of values

    robik
      Is there any way I could set the condition on the list of values.

      For example if Value of the item x is null then use select ...

      and when value of the item x is not null use this select ....

      :)
        • 1. Re: Conditional list of values
          Roel
          You could use two items with different select lists and render either the one or the other depending on those conditions

          or

          when both the select lists should return values to the same db column, you can create one select statement:
          select a,b from tableX where :PFIELD1 = 'X'
          union
          select d,e from tableY where :PFIELD1 = 'Y'
          (and specifiy PFIELD1 as the Parent LOV field)
          • 2. Re: Conditional list of values
            Mindmap
            Hello,
            If it is completely different Select Statement based on item X. Why do not you create new LOV Items A, B ... When X is null A shows up and B is hidden and vise verse ....

            using Cascading LOV Parent Item(s) Could be helpful to you also ..


            Best Regards,
            Fateh
            • 3. Re: Conditional list of values
              Jitendra
              Hi Robik,

              Try the below given code.

              I am giving you a sample how to achieve this, Edit according to you requirement.
              Page item to Submit : P1_ITEM_X
              List of Value Definition : 
              
              IF (:P1_ITEM_X is null) THEN
              RETURN
              'select COLUMN1 display_value,COLUMN1 return_value from TABLE1';
              ELSE
              RETURN
              'select COLUMN2 display_value,COLUMN2 return_value from TABLE2';
              END IF;
              Hope this will helps you,

              Regards,
              Jitendra
              • 4. Re: Conditional list of values
                Mindmap
                Great solution, I had a similar problem before, and I felt that my solution was not solid at all....

                Thanks..