Monday, March 21, 2011

Invalid values in choice lists

There are some cases that in database there are some values in fields that are not selectable any more in List for the specific fields.
For example there can be a lookup table for Status that some values can be selected by user and other that only the system can set.
An other case are Types that are not valid any more but exist for old data.
So if you have limited the data of a choice list with a where statement there is a chance that, data exist for the limited rows. The behavior of choise list then is quite problematic.

To demonstrate it in HR schema I limit the DepartmentView to have only departments that have managers (WHERE Departments.MANAGER_ID is not null) and jobs WHERE Jobs.MIN_SALARY<4000. In a simple adf form if you go to an Employee that has a department without a manager then the department choice list seems to have no value and 2 empty selections.
Also in the log you see the message:
ADFv: Could not find selected item matching value 210 of type: oracle.jbo.domain.Number in the list-of-values.
User thinks there is no department for employee and he can make changes (not on department) and save yet the department is not set to null.

If you go to an employee that has invalid job you see again the choice list empty, even though it has a value. If you try to change any other field and submit you get the required field error even though it has a value.


Similar issue exists when Choice List is dependent to another field. Then if you change the other field and choice list does not have a valid value any more it shows empty even though the value still exist in view object. In this case you need to define dependency on view attributes so that the choice list becomes null every time you change the other field. This way though the choice list value will be lost even if it is valid.


Test Case:



Still reproduce in 11.1.2

SR and bug Bug 12320392: JDEV 11.1.1.4.0 INVALID ENTRIES IN SELECTONECHOICE
was posted for this. Yet it is rejected by the Oracle development team with the answer:
=== ODM Answer ===
From the Bug request # 12320392 - JDEV 11.1.1.4.0 INVALID ENTRIES IN SELECTONECHOICE
BDE team has answered as follows:

Currently there is no way to do this automatically for selectonechoice component. Which is why for this use case you should use af:inputListOfValues or af:inputComboboxListOfValues (ADF LOV Choice List).

Saturday, March 19, 2011

Jhug

Jhug is Java Helenig User group
http://www.jhug.gr/
It is a very active user group with great people that i had the pleasure to meet. Among others they organise monthly meetings in greece, discussing technology development and making presentations. I have attended 2 times and had the honor to make a presentation about jdeveloper 11g
http://adfbugs.googlecode.com/files/Jdeveloper%20IDE.pdf
I find this user group very usefull and helpfull and wish to continue like this.