How To Add an Extra Choice for a Null value in a Databound messageChoice Component (Doc ID 329609.1)

Last updated on AUGUST 04, 2016

Applies to:

Oracle JDeveloper - Version: 10.1.2.0.0 and later   [Release: and later ]
Information in this document applies to any platform.

Goal

You have created a UIX application that includes a messageChoice (drop down list) component, as explained in document "How To use the List Binding Editor with ADF UIX" on OTN.
For example, a list of the Departments that can employ an Employee:

The list works fine, but your data model allows to nullify the value.
When you don't have the list, you can just nullify the value in the field.
But how to do it when you have a list?
There doesn't seem to be an extra option to specify that the messageChoice should also include the Null value.

If you have some JSP experience, you know you can add an extra HTML:OPTION to the HTML:SELECT tag:

<html:option value="Null">No Department</html:option>
You may try to define an equivalent in UIX, by using <option text="No Department" value=""/>, like the following
</messageChoice>
But as result, you get "No Department" repeated in the list as many times as you have entries in the list:

Solution

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms