Create a properties file
- Right click on a folder in the view controller
- Select new and choose "File"
- Name the new file and add the .properties extension
- In this new file, insert an entry with an id and a value, this entry will be the null selectable value in the LOV
Create a variable
- Go to the page definition file and right click the "Variables" in the "Executables" section
- Select "Insert inside variableIterator"
- Select "Variable"
- Set a name and set the type as "java.lang.String"
- Create the binding based on the new created variable
- Select the add in the "Bindings" section
- Select "Attribute Value", set as datasource the "Variables" section
- Select the new created variable and press ok
Create the select one choice based on VO
- In a Jsff fragment, drag and drop an instance of the View Object, select "Single Selection" and then "ADF Select One Choice"
- A window will appears where you can select which attribute to display, select "Ok"
- Remove the validator and the required attribute
- Add the attributes autosubmit="true" and immediate="true"
- Replace the default inputValue with the new created variable
Adjust settings' LOV
- Open the page definition source from the fragment
- After the tag <bindings></bindings> add this code and modify the property "PropertiesFile" with the correct path of the previous created file<ResourceBundle>
<PropertiesBundle xmlns="http://xmlns.oracle.com/adfm/resourcebundle" PropertiesFile="path.properties.file"/> </ResourceBundle> - Select the LOV in the page definition file and in the Properties tab edit the attribute "ListOperMode" to "setAttribute"
- Edit the "NullValueId" attribute. This attribute defines the id that needs to be read in the previous properties file.
- Ediit the "NullValueFlag" attribute to "start". This attribute defines the position of the null value in the LOV.
showRequired="true"
immediate="true"
If no selection was made on the LOV and the user wants to commit, we need to add a warning popup specifing to select a value on the LOV.
This check can be made by checking if the inputValue in the selectOneChoice is not null.
No comments:
Post a Comment