maandag 16 december 2013

ADF: annoying warnings

Fact

In the logging of your application server, you see often the following warning :

<SimpleSelectOneRenderer><_getSelectedIndex> Could not find selected item matching value "0" in RichSelectOneChoice[UIXEditableFacesBeanImpl, id=value70]

Problem

You are probably using a component which generates fields dynamically, like the query-component.  If you have defined a LOV for one of the fields this component needs to show and you have specified that it needs a "No Selection" item in the UI Hints of the LOV, then this warning will popup.

The warning you are getting is just saying that he tries to map a selected value "0" to the list he recieves, in which case he did not find it.  The id is pointing to the field in the query component in this case.  The fields are numberd from value00, value10, value20 to valueXX.

Solution

The solution is to remove the selection of the "No Selection"-item, but this will probably add another problem to your list.  To solve this problem you can do the following depending on the type of the view-component of your LOV.

  • View based on static values.
    In this case just add an empty row and put it on top.  The order for these kind of views is determined by the order in the list.

  • View based on a query.
    In this case just add an union-clause and add an empty row through the dual-table.  Also add an order by-clause to put the null-row first.