Tuesday 20 March 2018

Set Default Value of selectOneChoice from Bean in ADF 12c

Hello everyone in this post you will see

1  -  Create selectOneChoice manually
2  -  Set default value of selectOneChoice from bean
3  -  Get selected value in bean

for this post i am using jdeveloper 12.2.1.2.0

Lets start

1  -  Create selectOneChoice manually

Steps  1 -  Create new application
Steps  2 -  Create connection
Steps  3 -  Create Department view Object and then a jsf page

Steps  3 -  Click on the source tab of jsf page and then you need to create the af:selectOneChoice manually


Steps  4 -  Select  af:selectOneChoice and drop a af:forEach component on it
Steps  5 -  Then drop f:selectItem on af:forEach



Steps  6 -  Go to the Bindings tab of your jsf page and create a Tree Binding of Department vo


Steps  6 - Select af:forEach then go to properties pallet select Items value form binding and create a variable d



Steps  7 - Select f:selectItem from structure window and go to properties pallet and set the value of
item Label and item Value like following



Now Run your page


2  -  Set default value of selectOneChoice from bean

To set default value of selectOneChoice

Steps  1 -  Create value binding of selectOneChoice with bean and initialize the property in bean with the department id that you want to set as a default value




Now Run your jsf page you will see the Department Name againt Department id 90



3  -  Get selected value in bean

To get the selected Department Id in bean

Steps  1 -  Create valueChangeListener binding of selectOneChoice with bean
Steps  2 -  set autoSubmit =true of selectOneChoice




Run your page change the value of selectOneChoice



No comments:

Post a Comment

Query to get Business unit (ORGANIZATION_ID) Detail in oracle Fusion

  SELECT HAO.ORGANIZATION_ID AS BUSINESS_UNIT_ID,         HAOT.NAME,         HAO.BUSINESS_GROUP_ID,         HAO.EFFECTIVE_START_DATE,       ...