How to add the option in the SelectItem during execution
HelloCan anyone help me please with this use case?
I have a list set to the managed bean as below. I want to add new LOV in list (DROP DOWN 2) "ZZZ" based on the value selected in the DROP DOWN 1 on the same page. So that particular one value selected in the DROP DOWN 1, I want to have this new LOV displayed in the DROP DOWN 2. I'm doing it through ValuchangeListener, but I'm not able to find how to add the LOV. Help, please.
USER INTERFACE
<!-- DROP DOWN 1 -->
<af:selectOneChoice label="Order Type" id="soc2" required="true"
validator="#{lovManagedBean.orderTypeValidator}"
binding="#{userAuthentication.orderType}"
autoSubmit="true"
valueChangeListener="#{lovManagedBean.orderTypeValueChangeListener}">
<f:selectItems id="si2" value="#{lovManagedBean.orderTypeItems}"/>
</af:selectOneChoice>
<!-- DROP DOWN 2 -->
<af:selectOneChoice label="Request Type" id="soc1" required="true"
validator="#{lovManagedBean.requestTypeValidator}"
binding="#{userAuthentication.requestType}">
<f:selectItems id="si1" value="#{lovManagedBean.requestTypeItems}" />
</af:selectOneChoice>
Managed Bean code public List<SelectItem> getRequestTypeItems() {
List<SelectItem> list = new ArrayList<SelectItem>();
list.add(new SelectItem("XXX","XXX"));
list.add(new SelectItem("YYY","YYY"));
this.requestTypeItems = list;
return list;
}
public void orderTypeValueChangeListener(ValueChangeEvent event ) {
System.out.println("+++ Calling LOVManagedBean.orderTypeValueChangeListener()");
System.out.println("Old Value for order type:" + event.getOldValue() );
System.out.println("New Value for order type:" + event.getNewValue());
if(event.getNewValue().equals("Time and Expense")){
//Code to add LOV in drop down
}
}
You could make it according to the following example:
Sample.JSPX:
xmlns:f = "http://java.sun.com/jsf/core".
xmlns:h = "http://java.sun.com/jsf/html".
xmlns:af = "http://xmlns.oracle.com/adf/faces/rich" >
*
autoSubmit = 'true' immediate = "true".
* valueChangeListener = "#{pageFlowScope.SampleBean.onValueChangeListener}" > *.
*
*
**
*
* partialTriggers = "soc1."
* Binding = "#{pageFlowScope.SampleBean.selectOneChoice2}" > *.
*
* id = "si3" / > *.
**
* SampleBean.Java: *.
import java.util.ArrayList;
import java.util.List;
Import javax.faces.event.ValueChangeEvent;
Import javax.faces.model.SelectItem;
Import oracle.adf.view.rich.component.rich.input.RichSelectOneChoice;
public class SampleBean {}
Private RichSelectOneChoice selectOneChoice2;
public SampleBean() {}
DataSource.Add (new SelectItem ("XXX", "XXX"));
DataSource.Add (new SelectItem ("YYY", "YYY"));
System.out.println ("to the constructor");
}
Private list
* public Sub onValueChangeListener (ValueChangeEvent valueChangeEvent) {*} public void setDatasource (the list data source
public
public void setSelectOneChoice2 (RichSelectOneChoice selectOneChoice2) {} public RichSelectOneChoice getSelectOneChoice2() {} * Ensure that the bean is saved in pageFlowScope.* Thank you
private SelectItem newSelectItem = new SelectItem ("ZZZ", "ZZZ");
* if (valueChangeEvent.getNewValue () .equals ("Add") == true) {*}
* System.out.println("::: Adding new select item choice"); *
* datasource.add (newSelectItem); *
*} else {*}
* if (valueChangeEvent.getNewValue () .equals ("JustSelect") == true) {*}
* System.out.println("::: Removing the added select item choice"); *
* datasource.remove (newSelectItem); *
* System.out.println (datasource.size ()); *
*}*
*}*
* this.selectOneChoice2.setValue (datasource); *
*}*
This.DataSource = data source;
}
Returns the data source;
}
this.selectOneChoice2 = selectOneChoice2;
}
Return selectOneChoice2;
}
}
Nini
Tags: Java
Similar Questions
-
How to get the content during execution classpath
In production mode, I can't stop the weblogic server. In the command line window, shows that recent information. How to get the content of the classpath of weblogic domain?You can view the log file of the server under the location *
/servers/ /log / *. The log file contains the details about the CLASSPATH setting. A typical classpath is represented by the java.class.path attribute in the log file.
See you soon,.
Julien
http://WebLogic-wonders.com -
How to add the new column in existing table to our desired location?
How to add the new column in existing table to our desired location?
For example, I have to add the new column 'course' before the salary column in the emp table.
I think the best way is to add the column at the end of the table and create a new view with the order of the columns...
Another option...
places the data into a temporary table and recreate the table with the correct order of the columns, and then insert data to the table from the temporary table
Refer
Add column (from table) in the desired position
Example:
CREATE TABLE temp_my_user LIKE)
SELECT * FROM password);
DROP TABLE password;
(Password) CREATE TABLE
userID NUMBER
, first name VARCAHR2 (25)
, middleInitial VARCHAR2 (1)
(, name VARCHAR2 (25));
INSERT INTO password (userID, firstName, lastName)
(SELECT username
first name
lastName
OF temp_my_user);
DROP TABLE temp_user;
-
How to add the date felxfiled in OFA
How to add the date felxfiled in OFA
Hi gurus,
How to add a date in the form OFA field. I tried but no optin schedule it. I need to add the calendar options before the flexfiled.
Concerning
Hello
Allocate FND_STANDARD_DATE segment value your FDF everywhere where you want to see the calendar on the page of the OFA.
Let me know if you need more help on this.
Kind regards
Hemant
-
How to add the blank page to existing Document in Adobe Dc
How to add the blank page to existing Document in Adobe Dc Pro
You can add a blank page using Adobe Acrobat DC by following the instructions below:-
(1) open your PDF in Acrobat DC.
(2) choose the form of option "Organize the Page" of the tool pane on the right as shown below in the screen shoot.
(3) now, at the top, you will see all the tools to organize the page, click "Insert" & select 'White Page' in the drop down menu to insert blank pages.
* Shortcut: If you are using a windows computer you can use the key "Shift + Ctrl + T" to insert blank pages.
In case if you have any problem or have any questions please let us know. We will be happy to help you.
Kind regards
Nicos
-
How to add the table radio button.
Hello
I want to update the record if I want that an option of button raduio shaped tabular .There is no option for tabular.
How to add the table radio button.
Thank you
Published by: 805629 on February 3, 2011 04:56Use APEX_ITEM. BOX API in the definition of SQL query for the form of tables
-
How to add the name of the title of graph in Excel
Dear friends
I'm using LabVIEW 8.0.I need how to add the name of the title of graph in Excel.
You have the report generation tool? If so, the VI of graph Easy Excel has an entry for this.
If you don't have the Toolbox, then you need to use ActiveX. Please do a search on the use of the ActiveX (there are examples provided with LabVIEW) to control Excel. Also, there are many examples in the thread Excel. NOTE: DON'T POST QUESTIONS IN THIS THREAD.
In the end, you will need to search for information contained in MSDN.
-
How to add the full value of two buttons?
How to add the full value of two buttons (any key) VI and display it in the output text box? I am attaching a sample program, but I know that his evil... Help, please
Try this
-
How to add the quick launch of the desktop icon bar
How to add the toolbar launch quick icon on the desktop. I can't find a desktop icon that will drag on
The following Microsoft KB article
http://support.Microsoft.com/kb/190355/en-us
will help you.
Good bye.
-
How to add the translation application to my email add FB?
Original title: translation
I need to know how to ADD the TRANSLATION software to my email add FB? Any help?
Try here: https://www.facebook.com/help/100117036792266
Translate the updated Facebook application on the road
-
Hi, I want to try to use Quazip. Since I read, I have to add the library before use.
I downloaded from http://quazip.sourceforge.net/
How to add the Quazip library? Please explain the step, never add lib before.
Thank you
I have change the .pro file
Like this:
http://StackOverflow.com/questions/13341234/unzip-files-downloaded-from-Server
-
How to add the profile of lenses?
How to add the profile of lenses?
At the bottom of the link, you will find a link for the lens profile downloader. With this tool, you can download the profiles shared by other users.
Work with lenses profiles in Adobe Photoshop, Lightroom and Camera Raw
-
How to add the bar at the bottom of the page [Dreamweaver]
Hello!
How to add the bar at the bottom of the page that helps me to make changes in my creation page?
Not sure I understand. Looking for the properties panel? Press Ctrl + F3 or go to window > properties.
Nancy O.
-
Please tell me how to add the English language in photoshop?
Hello! Please tell me How to add the English language in photoshop? I'm from Russia and acquired, respectively, also in Russia()
Cloud of swap language http://helpx.adobe.com/creative-cloud/kb/change-installed-language.html
or
A product of Adobe for another language or version of trading platform for CS6
-
How to add the collapsible functionality to the Spry Menu?
Dear Adobe community,
How to add the functionality of collapsible for the Spry Menu like the one on the White House | whitehouse.gov ?
Load the White House Web site and minimize your browser window as observe you what happends to the menu bar when you pass a certain limit.
This is the feature that I want to put in place and I would be happy if one of you could direct me to or share relevant information.
Concerning
Andreas
This isn't a menu Spry Spry do not appear on mobile devices.
Use any sensitive menu you like for example:
CSS & jQuery Mobile Navigation Menu Demo
The tutorial is here:
Maybe you are looking for
-
How to access my library icloud on iPad mini?
Please help me with this
-
Error when reinstalling windows from recovery disks
My laptop crashed and could not find Windows, so I ordered a recovery disk (TR-IM00209299 - Win7 64 bit HomePremium (NH) SP1) through Toshiba recovery media shop. Now that I got the Windows 7 recovery discs, but they do not install successfully, and
-
DVD drive does not write - Satellite M40X-175
Im having a problem with my dvd. I tried to burn my movies, music and my files on a dvdr or cdr, I tried DVD - RW and CD - RW but I do it every time gives error "d:\ is not accessible incorrect function". but when I try to watch a dvd movie or use my
-
How to add a PXI on DAQmx device to simulate
Hello I am trying to create a simulated map PXI-8461 DAQmx device. But it is not in the list of devices that I can create. How can I add this devie point to the list? Thank you very much Ray
-
Can you let me know more about Microsoft Developer Network?
Can you let me know more about Microsoft Developer Network? Im just curious. Is it for the creation and the creation of an application?