Showing posts with label Choice List. Show all posts
Showing posts with label Choice List. Show all posts

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).

Tuesday, January 11, 2011

Choice List Loose value in disclosed af:Query (Fixed in 11.1.1.4)

Choice lists seem to be quite sensitive on loosing their value. Apart from popups with full submit button, they loose their values also inside af:query component when it is closed and submited.
In a simple Query page with Query panel and result table I put some criteria values:


Then i close the Search panel and i press Submit button


When i open Search panel again the selected value in department choise list is lost


Is this a nice bug or what?
Test Case:
http://adfbugs.googlecode.com/files/TestDisclosedCriteria.zip

Monday, May 31, 2010

Choise list in popup turn to null after submit (Fixed in 11.1.1.4)

After migration we have strange behavior in popups with choise list, file upload and other components.
I managed to reproduce it in a simple test case with a table and a Edit popup with a simple choise list.
The first time i open popup it looks ok

If i press 'Submit' button (full submit) the popup is closed as expected since it is autoCancel enabled.

But if i open popup again, then the coise list is empty!!??


This causes other side effects. I.e. if you have partial trigger in popup components from page table, then when you change a line after you have closed popup with submit you get the following error:



The following does not happen if you press the ok/cancel dialog buttons or x button.

The workaround we are using is not to use full submit buttons in popups, and close popup programaticaly in backing bean:

public void closePopUp(String popUpId){
FacesContext facesContext = FacesContext.getCurrentInstance(); ExtendedRenderKitService service = Service.getRenderKitService
(facesContext, ExtendedRenderKitService.class);
service.addScript(facesContext, "AdfPage.PAGE.findComponent('templateid:"+ popUpId
+"').hide();");
}


Also with autocancel = enabled, then a partial submit button and a partial trigger on popup or on parent component will close the popup without problem.

Test case:
http://adfbugs.googlecode.com/files/TestPopup.zip

Monday, January 25, 2010

Required Criterion on Choice List type Attribute.(Fixed in 11.1.1.3)

Trying to replace some inputListOfValues fieds that have small amount of data with choiseList components we fall into the following.

If the choice list attribute is used in view criteria as a required criterion then even if you select a value, validation error ‘Error: A value is required.’ Still shows up.


This happens even when attribute is set to autoSubmit.

Is this a bug?

We use input list of values instead as a workaround.

Test case:
http://adfbugs.googlecode.com/files/TestRequiredChoiseList.zip