I have noticed in latest JDeveloper 11g release, LOV components present in Query Criteria are not validated by default. In order to make it work correctly, you need to change attribute property in View Object.
Here I'm describing how to validate LOV components in Query Criteria. Download sample application - LOVQueryValidation.zip.
By default, if you enable LOV's in Query Criteria, there is no validation applied. For example, if to type values not available in LOV list and press Tab button to navigate out of LOV, invalid value is accepted and LOV popup is not raised:
Definitely you can notice that auto submit action is not done - its why validation is not invoked. In order to make it work, open View Object and for those attributes defined as LOV components:
Open Control Hints section and change Auto Submit property to true:
Now LOV validation works for both - String type attributes:
And Number type:
Hi!
ReplyDeletehere i am again...
i'm fighting with a use case, similar to this but with one little diference.
I have a Query criteria and a lov inside of it, every thing ok.
but now I need the lov to be filtered so I follow the steps needed to pass the value to the bindvar defined in the viewCriteria of the Lov.
and doesn't work. the lov in the viewCriteria doesn't take the value.
Any idea?
Rowan.
Hi!
ReplyDeleteI need to ask you something...
why in page def in executables is defined a variables iterator??
Is it needed?
Rowan
Hi,
ReplyDeleteNo, its not needed actually. Its just generated by JDeveloper automatically, but you can remove it, I think :)
Andrejus
How to achieve this LOV validation in ADF 10g?
ReplyDeleteHow to achieve this LOV validation in ADF 10g ? LOV is implemented as af:selectInputText with LOV search page opening in separate dialog page.
ReplyDeleteIs supported only from 11g.
ReplyDeleteAndrejus
Andrejus, even though the "Auto Submit" is set to true .
ReplyDeleteIn my edit form I am giving emlployee_id : 123 which is not there in LOV and then hitting on Save, the data does not save as it is invalid, but i want to throw a exception to the user to give a valid one . any pointers ??
And what happens if you press Tab?
ReplyDeleteAndrejus
If the user hit the tab it works fine and fires the validation as mentioned but what if the user hit directly "SAVE" button. Though the data is not updated but it also throws no exception and hence forth the user might think that everything might have gone good.
ReplyDeletePlease suggest.
Thanks
Sumit Yadav
Just to add some more info, even if i tab out, the LOV pop out as it is a invalid data and i can select from the LOV, But if i do not select any value from the LOV, the focus again goes to the same place and i can hit save now,with out any exception.
ReplyDeleteOn further debugging ,I put a logic on the commit method to check the values before commit,which throws error if the values written is not one among the LOV. ,I found that the bindings of the particular columns never got refreshed,it still holds the old data in the edit form.
and hence no error.
Not sure how to handle this .
Don't you think we should at least throw some kind of user exception .
Waiting for your expert advise .
Got the solution.
ReplyDeleteThe cause was because i was using a
showpop behavior component to invoke the popup, which was getting fired first and then the other validation were off there.
Lesson better to invoke Pop-up programatically and it worked kool.
Thanks
Sumit Yadav
Cool, you are finding solution faster, than I read comments :)
ReplyDeleteHello,
ReplyDeleteDo you know if it still works on 11.1.1.5, because I tested it and it doesn't work on my project...
Regards.
Very helpful post. I thought that this functionality wasn't available. Thanks for the post. Fernando
ReplyDeleteHello Anderjus,
ReplyDeleteI have LOV (inputComboboxListOfValues) when i enter few characters and hit tab its automatically showing Query Search Form component in my page i want to prevent that is there any option to prevent it when user enter some characters and press tab it should show some exception or error.
Thanks
Praveen :-)
ReplyDeleteHello Andrejus,
Thank you very much for this post i have opposite requirement of this i have LOV(inputComboboxListOfValues) when user enter few characters and press tab it was showing Query Search Form component on the page how to prevent that poup.
Thank
Praveen :-)
Hi Raja Sekhar,
ReplyDeleteON the desired Page, on LOV property- set the Auto Submit to false.
Thanks
Sumit Yadav