10 Replies Latest reply on Oct 20, 2010 3:46 PM by 526357

    How to validate LOV Field?

    526357
      Dear Members,

      I have an OAF Page in which there are two fields i.e., F1 and F2.
      I have created two lov's Lov1 and Lov2. Lov2 is a dependent lov based on Lov1.

      Lov1 attached to F1.
      Lov2 attached to F2.

      When Iam entering the values in F1 or F2 which are not listed in their respective lov's, no error is encountered. Iam able to save these values as well.

      Can any one please tell me how to validate the lov fields i.e., My requirement is whenever I enter some wrong value which is not listed in the lov, I want to display an error.

      I tried by selecting the value 'Yes' for the property 'Use for Validation' in lovmappings and still there is no use.

      Many thanks in advance.

      Best Regards,
      Arun Reddy D.
        • 1. Re: How to validate LOV Field?
          AnilSharma
          try these steps:

          What we have to do is this.

          1. Create a formValue field in the form.
          2. In the LOV create one more mapping, with Return Item as the ID for the formValue field Created.
          3. Also for this mapping, set 'Use for Validation'=yes.

          It works like a charm now and user cannot enter invalid values.

          Thanks
          --Anil
          http://oracleanil.blogspot.com/
          • 2. Re: How to validate LOV Field?
            AnilSharma
            OA Framework

            Thanks
            --Anil
            http://oracleanil.blogspot.com/
            1 person found this helpful
            • 3. Re: How to validate LOV Field?
              526357
              Hello Anil,

              Thank you very much for the valuable information given. I have followed the below steps:

              Background:

              In my OAF Page I have headers section and lines section.

              My headers section region is of type MESSAGE COMPONENT LAYOUT. In this region I have a field i.e., Field-1 whose type is message lov input. For this Field-1 I have attached an external lov i.e., Lov-1.

              Steps followed:

              1/ In the headers region I have created a new item of type MESSAGE LAYOUT. Under this I have created a new item i.e., Item-1 whose type is FORM VALUE.
              2/ In the Field-1, I have created a new lov mapping i.e., LovMap-2 and set its return item to Item-1.
              3/ Also for this new LovMap-2 I have selected the value YES for the property USE FOR VALIDATION.

              Now when user enters a wrong value which is not listed in the lov and when he tries to save the record it gives an error message saying it is not a valid value.

              Perfectly working fine as per your guidance.

              But my requirement is when user enters some invalid value in the Field-1 and when he tries to navigate out of the field an error message should be displayed. In other words I should not allow the user to select any invalid value. Can you please guide me how to acheive this requirement.

              Iam new to OAF and finding difficulty to acheive this requirement. Kindly please help me.

              Many thanks in advance.

              Best Regards,
              Arun Reddy.

              Edited by: A4S on Oct 12, 2010 7:14 PM
              • 4. Re: How to validate LOV Field?
                AnilSharma
                Hi Arun,

                I think as soon as the user enter some invalid value LOV window should popup automatically, which actually means user has entered a invalid value.

                I hope this feature is working in LOV created by you.

                Thanks
                --Anil
                http://oracleanil.blogspot.com/
                1 person found this helpful
                • 5. Re: How to validate LOV Field?
                  526357
                  Hello Anil,

                  Yes as soon as the user enters some invalid value, LOV window is getting popup automatically.

                  But my problem is as follows:

                  Let us say LOV has values A,B,C. User entered D which is a invalid value. As soon as he enters D, LOV Window is populated automatically. In the LOV Window user can click cancel button and he is able to navigate to the other field. But I want to prevent user from navigating to other field when he enters an invalid value.

                  Same like When-Validate-Trigger functionality in Oracle Forms. In Oracle Forms when we select the option YES for the property 'Validate From List', User cannot navigate to other field when he enters an invalid value.

                  Same functionality I want to implement in OAF. Can you please guide me.

                  Many thanks in advance.

                  Best Regards,
                  Arun Reddy D.
                  • 6. Re: How to validate LOV Field?
                    AnilSharma
                    For this you can go for implementing VVO functionality i.e Validation View Object.

                    Brief Steps you have to perform on LOV Event:

                    1. Create a VVO. Its nothing but a View Object with the same query as List of Values.
                    2. Now pass the return value to this ViewObject and execute its query.
                    3. If it return a row that means its a valid value else its a invalid value and throw exception.

                    Thanks
                    --Anil
                    http://oracleanil.blogspot.com/
                    1 person found this helpful
                    • 7. Re: How to validate LOV Field?
                      Gauravv
                      Hi,

                      Anil's suggestion is fine... it should work right at the field level..

                      but normally, we check on form submit that if invalid value has been selected then donot let the page submit or navigate.

                      This you can achieved by using formvalues

                      1) create a formValue with View Attribute same as Critirea item value.
                      2) create a lovMap with lov region item as value returned on critirea item
                      and return item as formValue and set the required property to true.

                      this will display the standard Oracle error for invalid value as the user will try to submit the page.

                      Thanks,
                      Gaurav
                      1 person found this helpful
                      • 8. Re: How to validate LOV Field?
                        AnilSharma
                        Bingo !!! ;)

                        Already given this solution above.


                        Thanks
                        --Anil
                        http://oracleanil.blogspot.com/
                        1 person found this helpful
                        • 9. Re: How to validate LOV Field?
                          Gauravv
                          Great!!!!

                          :) :) :)
                          • 10. Re: How to validate LOV Field?
                            526357
                            Hello Anil,

                            Thanks for your valuable suggestions.

                            Gaurav thanks to you as well.

                            I will try to implement the VVO functionality to meet my requirement.

                            Once again thank you very much.

                            Best Regards,
                            Arun Reddy D.