Get the selected item in a dropdown
please how can in get the selected item in a dropdown ?
I am using t"his.selectedIndex" but it gives me just de index of the previous selected item, I am using the CHANGE event with javascript
I found the solution with xpa.event.newText
Similar Messages
-
How to get the selected items from listbox
Regarding listbox i have two questions
1) I want to get the selected items as per the order in which ihave selected.Presently i'm getting in the ascending order.For example after selcting the 1,2,6 if i select 3 then its giving 1,2,3,6.But i want it in the order 1,2,6,3
2)I want to select items from a single list box to many other listboxes.(ie) my first selection should goto first,second one to the second listbox and like this.How should i write the logic.
please give me a suggestion.In order to have the selected items line up in accordance to the selection order, please do it one at a time. (That's the limit for that VI)
If you need more than that (i.e. to regconize which item clicked first and which one comes later), you may have to figure it out ya
Wish you good luck. Perhaps, someone else has a already made vi.
Cheers!
ian.f
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010
依恩与LabVIEW
LVVILIB.blogspot.com -
Hello,
I created a Selection screen by adding attribute M_HANDLER of type IF_WD_SELECT_OPTIONS.
This way I can create a selection screen with normal select-options.
Now I added a parameter for a dropdown list. The Value set is passed correctly. No problem there. The values are filled and diplayed correctly.
* add the SHIP-TO field to the selection
DATA: ltp_text TYPE string.
DATA: lta_ship_to_table type WDY_KEY_VALUE_table,
lwa_ship_to like LINE OF lta_ship_to_table.
DATA: context_node_ship_to_table TYPE REF TO if_wd_context_node.
* get all declared attributes
context_node_ship_to_table = wd_context->get_child_node( 'SHIP_TO_TABLE' ).
context_node_ship_to_table->get_static_attributes_table(
IMPORTING
table = lta_ship_to_table ).
ltp_text = wd_assist->if_wd_component_assistance~get_text( 'L01' ).
wd_this->m_handler_dlv->add_parameter_field(
i_id = 'KUNWE'
i_description = ltp_text
i_as_dropdown = 'X'
it_value_set = lta_ship_to_table
i_within_block = 'BLK1' ).
The problem is to GET the selected value in the method that is called after clicking on the Search button.
I tried using several methods, for example GET_PARAMETER_FIELD and GET_SELECTION_SCREEN_ITEMS.
* Get the Ship-to
DATA: ltp_kunwe TYPE REF TO data.
ltp_kunwe = wd_this->m_handler_dlv->get_value_of_parameter_field(
i_id = 'KUNWE' ).
* Assign it to a field symbol
ASSIGN ltp_kunwe->* TO <fs_kunwe>.
Result was INITIAL.
DATA: lrf_get_selection_screen_items TYPE if_wd_select_options=>tt_selection_screen_item.
wd_this->m_handler_dlv->get_selection_screen_items(
IMPORTING
et_selection_screen_items = lrf_get_selection_screen_items ).
Result was INITIAL, although the table was retrieved with all values.
wd_this->m_handler_dlv->get_parameter_field(
EXPORTING
i_id = 'KUNWE'
IMPORTING
e_value = ltp_kunwe ).
Also INITIAL.
It looks like I am missing a step (maybe to set lead selection for this field). What did I miss?
How can I get to the value?Thanks!
Problem solved:
DATA: lr_value TYPE REF TO data.
CREATE DATA lr_value TYPE string. "<---- I was missing this code
LOOP AT lta_ship_to_table INTO lwa_ship_to.
value_set-key = lwa_ship_to-key.
value_set-value = lwa_ship_to-value.
* INSERT value_set INTO TABLE lt_value_set.
append value_set TO lt_value_set.
ENDLOOP.
ltp_text = wd_assist->if_wd_component_assistance~get_text( 'L01' ).
wd_this->m_handler_dlv->add_parameter_field(
i_description = ltp_text
i_id = 'KUNWE'
i_value = lr_value "<---- I was missing this code
i_as_dropdown = abap_true
it_value_set = lt_value_set
i_within_block = 'BLK1' ).
I looked at that parameter, but thought is was only used to SET the value, not required to get it back as well. Because it IS an import parameter... -
How i can set the selected item of a dropDown component from java code
Hi
Thank you for reading my post
How i can set the slected item of a DropDown component from backing beans java code ?
it is binded with a database , so one field determine its display and one other field determine its value , I want to set the selected item of this combobox
In back code i have both value and display values to use them .
can some one give me some help ?
Thanks ,See code sample 3 at http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/helloweb.html
See also, the selection components row in the table under http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/helloweb.html
It says
One way to preselect items is to call setSelectedValue(Object[]) or setSelectedValue(Object) from the prerender() method. You pass in the return values of the items that you want preselected. Be sure to verify that getSelected() returns null before setting the default options, or you will overwrite the user's selections on a post-back. -
Getting the selected item of a form
Hi,
I added some matrix to the item-form for showing information on the selected item.
Now I need to know, which item is actually selected.
I'm searching but don't find it.
Regards,
Holger ReppertHi Ibai,
sorry for this stupid question. It's early in the morning
THX anyway.
Holger
PS: I thought of sth. like a pointer to the data ........
Message was edited by: Holger Reppert -
So, I am making an application in which binds data from a WebClient to a ListBox. Thus, it is needed to understand that I did not create this data, it is from a Web API. So my goal is to be able to click on any of the items in the list box(which are binded
from a web API) and open a pop-up to display more data binded from that specific area.
Example:
The data has been loaded and I click on the 2nd item, well this item is a Metallica concert located in Russia blah blah.. ok, so I press it, it opens a pop up with more info like the date, location, etc...
Info:
I am binding the things in the lost box from and "events" statement, and I want the data in the list box in the pop up to display the selected child item, "event".
Zack BowlingSo are you storing that 'more info data' along with main data(i.e. that metallica concert etc.) somewhere in a List/observableCollection/database etc, if yes then probably it can be fetched directly from that collection.
e.g.
private void listBox_Tap(object sender, System.Windows.Input.GestureEventArgs e)
var Itemobj = (listboxname.SelectedItem) as ObjectClassname; string datevalue = Itemobj.date; string location = Itemobj.location;
//so using Itemobj you can fetch the properties you want as stored in ObjectClassname.
// Here ObjectClassname is the name of class storing the properties(setter-getter) for the parsed data.
http://developer.nokia.com/community/wiki/Using_Crypto%2B%2B_library_with_Windows_Phone_8 -
Error setting the selected item in a dropdown component in a BPM
Hi,
The first step in the process is a human step where it's possible to select country in a dropdown box. The second step is also a human step where I try to display the same context that was selected in the first step.
I use the "merge" operation in the mapping, but the item that I select in the first step in the process is not selected in the second step in the process.
Does anyone know how to solve this?
Best Regards
MichaelHi Michael,
Only simlple types are supported in WD for EHP1 (Binary, boolean, byte, date, decimal, double, float, integer, long, short, string, time, timestamp)
No further Dictionary Types supported
(for example: currency)
Best Regards,
Karthik
Edited by: Karthik S J on Oct 15, 2008 2:34 PM -
Getting the value of the selected items of the shuttle
Hi Steve,
How to get the selected items of the shuttle in the backing Bean upon clicking submit button?
Regards,
GarethCheck the ADF Developer Guide and the SRDemo
application for a sample of using the shuttle
http://download.oracle.com/docs/html/B25947_01/web_com
plex008.htm#CEGHACEDHow to get the values from leading list. I have a pop-up with selectManyShuttle. The leading list values are retreived from from emailTable and there is no default values in the trailing List. When I click ok in the popup, the selectedValues is null.
here is my code:
<af:form>
<af:selectOneChoice label="" valuePassThru="true" valueChangeListener="#{backingpsEmailUserContact.refreshSelectedList}" id="usercontactid" autoSubmit="true">
<af:selectItem label="User" value="user"/>
<af:selectItem label="Contact" value="contact"/>
</af:selectOneChoice>
<af:panelHorizontal valign="bottom" partialTriggers="usercontactid">
<af:selectManyShuttle
trailingHeader="Chosen"
leadingHeader="Email"
trailingDescShown="true"
leadingDescShown="true"
size="10"
value="#{backingpsEmailUserContact.selectedValues}" >
<f:selectItems value="#{backingpsEmailUserContact.allItems}"/>
</af:selectManyShuttle>
<af:commandButton text="Ok" action="#{backingpsEmailUserContact.cmdOk}" id="cmdOkid" partialSubmit="true"/>
</af:panelHorizontal>
</af:form>
backingBean method
public void cmdOk(){
Object selectedList = this.getSelectedValues();
// for (int i = 0; i < selectedList.size();i++){
// System.out.println((String)selectedList.get(i));
} -
How to get the Clicked Item of a ListBox?
I need to get the clicked item of a listbox.
The item can be at first selected, when I click it again, it
automatically gets de-selected, but I want to get that item
whenever I click it. Any idea how to do this?
This line does not work, because it gets the selected item.
var pattern:String = event.currentTarget.selectedItem.myname;
This one must work,but something is missing.
Anyone can help me with this?
marks is my ArrayCollection;
var pattern:String =marks.getItemAt[??].myname;Here is my code. Am using this function in the itemclick
event of the ListBox.
My ListBox is a multi-select listbox. So am selecting several
items by pressing "Ctrl" key and selecting each item using click.
Say I have selected 4 items, when I press "Ctrl" and
de-select one of the items, I want to get the itemname of the
deselected item.
public function createMarksList(event:ListEvent):void{
// Alert.show(new
String(event.currentTarget.selectedItem.myname));
// var pattern:String =
event.currentTarget.selectedItem.myname;
// pattern = pattern += "," + pattern;
// text1.text = pattern;
<mx:List x="9" y="46" width="121" height="121"
id="lstMarks" allowMultipleSelection="true"
itemClick="createMarksList(event)"></mx:List>
So, your help is required here buddy.
I sitll can't figure out.
Thx -
How to directly get the selected value in the dropdown
Hi Experts
Now, in POV, i want to directly get the selected value in the dropdown. Because, the program doesn't enter the PAI before POV part. Therefore, the corresponding variable of dropdown doesn't store the selected value. That's reason why i want to find a way to directly get the selected value in the dropdown. is there any function module to do this?you can use INITIALIZATION event which triggers first before any other events..
and u can use VRM_SET_VALUES to populate the values in the list
DATA : v TYPE vrm_values.
DATA : vw LIKE LINE OF v.
INITIALIZATION.
vw-key = '1'.
vw-text = 'ABC'.
APPEND vw TO v.
vw-key = '2'.
vw-text = 'DEF'.
APPEND vw TO v.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = 'A'
values = v.
PARAMETERS : a TYPE c VISIBLE LENGTH 10 AS LISTBOX. -
I get an error message when importing from iPhoto that says, "There is not enough free space on your Aperture Library volume to import the selected items. It is estimated that you need at least 44GB of free space." the drive is empty, I just reformatted it to Mac OSX journaled.
I'm guessing this is an extrenal drive, correct? If so make sure the library you're importimng into is really located on the external drive. By default Aperture creates its library in your home pictures folder.
-
How to read the selected value of a dropdown list box
Hello,
I have 2 custom fields which are of type dropdown list on Accounts(CRMM_ACCOUNT) PCUI application details tab.I need to read the selected value of first dropdown list item,based on that second dropdown list will be populated.
I know where to populate the dropdown list box,it is in FILL_DROPDOWN_LISTBOX.
I dont know how to trap the selection made on dropdown list.
PLease guide me on how to trap the dropdown list field selection value.
Thanks in advance.
Thirumala.Hello,
Check what is done in standard for the fielf REGION which is inked to the country.
Otherwise, you can do the following :
- in field group customizing, for field 1, flag the 'send request' flag. So, when you change the value in this field via the dropdown, the MAC methods are immediately called.
- Put the new value in a global variable (GV).
- in the fill_dropdown_listbox method, get the value from this GV and based on it, filter the values for the dropdown of field 2.
Hope this will help you,
Regards,
Frederic -
How to get the selected values from a selectmanylistbox?
Hi ADF Experts,
<af:selectManyListbox label="Label 1" id="sml1" partialTriggers="cb2"
value="#{viewScope.TestBean.lovValue}"
autoSubmit="true" valuePassThru="true">
<f:selectItems value="#{viewScope.TestBean.actualList}" id="si1"
binding="#{viewScope.TestBean.selectedItems}"/>
</af:selectManyListbox>
<af:commandButton text="get selected values" id="cb3"
actionListener="#{viewScope.TestBean.getSelectedValues}"
partialSubmit="true"/>
private List<String> lovValue;
private List<SelectItem> actualList;
//getters and setters
public void getSelectedValues(ActionEvent actionEvent) {
// Add event code here...
for (String selectedItem : lovValue) {
System.out.println("Selected item: " +selectedItem.); // this is giving 1 and 3 like this. how to get the checked values as I'm getting only the indexes. In this scenario I am populating the list programmatically.Just I wanted to know how can we get the selected values(not indexes). Please suggest.
Thanks-
AbhijitHi Timo,
As I am sharing the page fragment and the Java class. So its my usecase I have mentioned below
I am sharing the jsff page fragment and java class. So that it wud be of help to others.
jsff page fragment
<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
xmlns:f="http://java.sun.com/jsf/core">
<af:panelGroupLayout id="pgl1">
<af:commandButton text="Search" id="cb1"
actionListener="#{viewScope.TestBean.searchSupplier}"/>
</af:panelGroupLayout>
<af:popup id="p1" binding="#{viewScope.TestBean.searchSupplierPopup}">
<af:dialog id="d2"
type="none">
<af:table value="#{bindings.Contacts.collectionModel}" var="row"
rows="#{bindings.Contacts.rangeSize}"
emptyText="#{bindings.Contacts.viewable ? 'No data to display.' : 'Access Denied.'}"
fetchSize="#{bindings.Contacts.rangeSize}"
rowBandingInterval="0"
binding="#{viewScope.TestBean.tsupportIssues}"
filterModel="#{bindings.ContactsQuery.queryDescriptor}"
queryListener="#{bindings.ContactsQuery.processQuery}"
filterVisible="true" varStatus="vs"
selectionListener="#{bindings.Contacts.collectionModel.makeCurrent}"
rowSelection="multiple" id="t1">
<af:column sortProperty="name" filterable="true" sortable="true"
headerText="#{bindings.Contacts.hints.name.label}" id="c2">
<af:outputText value="#{row.name}" id="ot1"/>
</af:column>
<af:column sortProperty="email" filterable="true" sortable="true"
headerText="#{bindings.Contacts.hints.email.label}"
id="c1">
<af:outputText value="#{row.email}" id="ot2"/>
</af:column>
</af:table>
<af:commandButton text="OK" id="cb5" partialSubmit="true" actionListener="#{viewScope.TestBean.testMethod}"/>
<af:commandButton text="Cancel" id="cb6"
actionListener="#{viewScope.TestBean.cancelPopupSearch}"/>
</af:dialog>
</af:popup>
<af:selectManyListbox label="Label 1" id="sml1" partialTriggers="cb5"
value="#{viewScope.TestBean.lovValue}"
autoSubmit="true" valuePassThru="true"
binding="#{viewScope.TestBean.prp1}">
<f:selectItems value="#{viewScope.TestBean.actualList}" id="si1"
binding="#{viewScope.TestBean.selectedItems}"/>
</af:selectManyListbox>
<af:commandButton text="get selected values" id="cb3"
actionListener="#{viewScope.TestBean.getSelectedValues}"
partialSubmit="true"/>
<af:commandButton text="remove selected" id="cb4"
partialSubmit="true" actionListener="#{viewScope.TestBean.removeSelectedValues}"/>
</jsp:root>
TestBean.java
package com.demo.view;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import javax.faces.component.UISelectItems;
import javax.faces.event.ActionEvent;
import javax.faces.model.SelectItem;
import oracle.adf.model.BindingContext;
import oracle.adf.model.binding.DCBindingContainer;
import oracle.adf.model.binding.DCIteratorBinding;
import oracle.adf.view.rich.component.rich.RichPopup;
import oracle.adf.view.rich.component.rich.data.RichTable;
import oracle.adf.view.rich.component.rich.input.RichSelectManyListbox;
import oracle.adf.view.rich.context.AdfFacesContext;
import oracle.adf.view.rich.event.DialogEvent;
import oracle.jbo.Key;
import oracle.jbo.Row;
import oracle.jbo.RowSetIterator;
import org.apache.myfaces.trinidad.model.RowKeySet;
public class TestBean {
private RichTable tsupportIssues;
private List<SelectItem> lovValue;
private List<SelectItem> actualList;
private RichSelectManyListbox prp1;
private List valuesChoosed = new ArrayList();
private UISelectItems selectedItems;
private RichPopup searchSupplierPopup;
public TestBean() {
super();
public void setTsupportIssues(RichTable tsupportIssues) {
this.tsupportIssues = tsupportIssues;
public RichTable getTsupportIssues() {
return tsupportIssues;
public void testMethod(ActionEvent actionEvent) {
// Add event code here...
// For learning purposes - show Select Many Button clicked
System.out.println("Select Many Button has been Clicked");
// // RowKeySet Object can hold the selected rows from a user as follows
RowKeySet rksSelectedRows = this.getTsupportIssues().getSelectedRowKeys();
// Iterator object provides the ability to use hasNext(), next() and remove() against the selected rows
Iterator itrSelectedRows = rksSelectedRows.iterator();
// Get the data control that is bound to the table - e.g.
// OpenSupportItemsIterator
DCBindingContainer bindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding dcIteratorBindings = bindings.findIteratorBinding("findAllContactsIterator");
// Information from binding that is specific to the rows
RowSetIterator rsiSelectedRows = dcIteratorBindings.getRowSetIterator();
// Loop through selected rows
int i=1;
while (itrSelectedRows.hasNext()) {
// Get key for selected row
Key key = (Key)((List)itrSelectedRows.next()).get(0);
// Use the key to get the data from the above binding that is related to the row
Row myRow = rsiSelectedRows.getRow(key);
// Display attribute of row in console output - would generally be bound to a UI component like a Label and or used to call another proces
System.out.println(myRow.getAttribute("name"));
valuesChoosed.add(myRow.getAttribute("name"));
// actualList = new ArrayList<SelectItem>();
// String j = Integer.toString(i);
// actualList.add(new SelectItem(j, (String)myRow.getAttribute("name")));
// i++;
searchSupplierPopup.hide();
AdfFacesContext.getCurrentInstance().addPartialTarget(prp1);
public void setLovValue(List<SelectItem> lovValue) {
this.lovValue = lovValue;
public List<SelectItem> getLovValue() {
return lovValue;
public void setActualList(List<SelectItem> actualList) {
this.actualList = actualList;
public List<SelectItem> getActualList() {
actualList = new ArrayList<SelectItem>();
if(valuesChoosed.size()!=0){
for(int i=0;i<valuesChoosed.size();i++){
actualList.add(new SelectItem(valuesChoosed.get(i), (String)valuesChoosed.get(i)));
else{
actualList.add(new SelectItem("1","Select One"));
return actualList;
public void setPrp1(RichSelectManyListbox prp1) {
this.prp1 = prp1;
public RichSelectManyListbox getPrp1() {
return prp1;
public void setValuesChoosed(List valuesChoosed) {
this.valuesChoosed = valuesChoosed;
public List getValuesChoosed() {
return valuesChoosed;
public void getValues(ActionEvent actionEvent) {
// Add event code here...
for(int i=0;i<valuesChoosed.size();i++){
System.out.println(valuesChoosed.get(i));
public void getSelectedValues(ActionEvent actionEvent) {
// Add event code here...
for(int i=0;i<this.getLovValue().size();i++){
System.out.println("Selected Value:"+this.getLovValue().get(i));
public void removeSelectedValues(ActionEvent actionEvent) {
// Add event code here...
public void setSelectedItems(UISelectItems selectedItems) {
this.selectedItems = selectedItems;
public UISelectItems getSelectedItems() {
return selectedItems;
public void setSearchSupplierPopup(RichPopup searchSupplierPopup) {
this.searchSupplierPopup = searchSupplierPopup;
public RichPopup getSearchSupplierPopup() {
return searchSupplierPopup;
public void cancelPopupSearch(ActionEvent actionEvent) {
// Add event code here...
searchSupplierPopup.hide();
public void searchSupplier(ActionEvent actionEvent) {
// Add event code here...
RichPopup.PopupHints hints = new RichPopup.PopupHints();
searchSupplierPopup.show(hints);
package com.demo.view;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import javax.faces.component.UISelectItems;
import javax.faces.event.ActionEvent;
import javax.faces.model.SelectItem;
import oracle.adf.model.BindingContext;
import oracle.adf.model.binding.DCBindingContainer;
import oracle.adf.model.binding.DCIteratorBinding;
import oracle.adf.view.rich.component.rich.RichPopup;
import oracle.adf.view.rich.component.rich.data.RichTable;
import oracle.adf.view.rich.component.rich.input.RichSelectManyListbox;
import oracle.adf.view.rich.context.AdfFacesContext;
import oracle.adf.view.rich.event.DialogEvent;
import oracle.jbo.Key;
import oracle.jbo.Row;
import oracle.jbo.RowSetIterator;
import org.apache.myfaces.trinidad.model.RowKeySet;
public class TestBean {
private RichTable tsupportIssues;
private List<SelectItem> lovValue;
private List<SelectItem> actualList;
private RichSelectManyListbox prp1;
private List valuesChoosed = new ArrayList();
private UISelectItems selectedItems;
private RichPopup searchSupplierPopup;
public TestBean() {
super();
public void setTsupportIssues(RichTable tsupportIssues) {
this.tsupportIssues = tsupportIssues;
public RichTable getTsupportIssues() {
return tsupportIssues;
public void testMethod(ActionEvent actionEvent) {
// Add event code here...
// For learning purposes - show Select Many Button clicked
System.out.println("Select Many Button has been Clicked");
// // RowKeySet Object can hold the selected rows from a user as follows
RowKeySet rksSelectedRows = this.getTsupportIssues().getSelectedRowKeys();
// Iterator object provides the ability to use hasNext(), next() and remove() against the selected rows
Iterator itrSelectedRows = rksSelectedRows.iterator();
// Get the data control that is bound to the table - e.g.
// OpenSupportItemsIterator
DCBindingContainer bindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding dcIteratorBindings = bindings.findIteratorBinding("findAllContactsIterator");
// Information from binding that is specific to the rows
RowSetIterator rsiSelectedRows = dcIteratorBindings.getRowSetIterator();
// Loop through selected rows
int i=1;
while (itrSelectedRows.hasNext()) {
// Get key for selected row
Key key = (Key)((List)itrSelectedRows.next()).get(0);
// Use the key to get the data from the above binding that is related to the row
Row myRow = rsiSelectedRows.getRow(key);
// Display attribute of row in console output - would generally be bound to a UI component like a Label and or used to call another proces
System.out.println(myRow.getAttribute("name"));
valuesChoosed.add(myRow.getAttribute("name"));
// actualList = new ArrayList<SelectItem>();
// String j = Integer.toString(i);
// actualList.add(new SelectItem(j, (String)myRow.getAttribute("name")));
// i++;
searchSupplierPopup.hide();
AdfFacesContext.getCurrentInstance().addPartialTarget(prp1);
public void setLovValue(List<SelectItem> lovValue) {
this.lovValue = lovValue;
public List<SelectItem> getLovValue() {
return lovValue;
public void setActualList(List<SelectItem> actualList) {
this.actualList = actualList;
public List<SelectItem> getActualList() {
actualList = new ArrayList<SelectItem>();
if(valuesChoosed.size()!=0){
for(int i=0;i<valuesChoosed.size();i++){
actualList.add(new SelectItem(valuesChoosed.get(i), (String)valuesChoosed.get(i)));
else{
actualList.add(new SelectItem("1","Select One"));
return actualList;
public void setPrp1(RichSelectManyListbox prp1) {
this.prp1 = prp1;
public RichSelectManyListbox getPrp1() {
return prp1;
public void setValuesChoosed(List valuesChoosed) {
this.valuesChoosed = valuesChoosed;
public List getValuesChoosed() {
return valuesChoosed;
public void getValues(ActionEvent actionEvent) {
// Add event code here...
for(int i=0;i<valuesChoosed.size();i++){
System.out.println(valuesChoosed.get(i));
public void getSelectedValues(ActionEvent actionEvent) {
// Add event code here...
for(int i=0;i<this.getLovValue().size();i++){
System.out.println("Selected Value:"+this.getLovValue().get(i));
public void removeSelectedValues(ActionEvent actionEvent) {
// Add event code here...
for(int i=0;i<this.getLovValue().size();i++){
System.out.println("Selected Value:"+this.getLovValue().get(i));
System.out.println(this.getLovValue().remove(i));
AdfFacesContext.getCurrentInstance().addPartialTarget(prp1);
public void setSelectedItems(UISelectItems selectedItems) {
this.selectedItems = selectedItems;
public UISelectItems getSelectedItems() {
return selectedItems;
public void setSearchSupplierPopup(RichPopup searchSupplierPopup) {
this.searchSupplierPopup = searchSupplierPopup;
public RichPopup getSearchSupplierPopup() {
return searchSupplierPopup;
public void cancelPopupSearch(ActionEvent actionEvent) {
// Add event code here...
searchSupplierPopup.hide();
public void searchSupplier(ActionEvent actionEvent) {
// Add event code here...
RichPopup.PopupHints hints = new RichPopup.PopupHints();
searchSupplierPopup.show(hints);
Thanks,
A. Abhijit -
¿How can I to get the selected index from a table in sapui5?
I have a multiselect table for each item I need to open a Dialog and bind then the table.
How Can I to obtain the index position from my table?
var myTable = sap.ui.getCore().byId(this.sId);
var myItem = sap.ui.getCore().byId(myTable.getSelectedItem());
Thanks in advance.Hi,
You can also use getSelectedContexts of table instance to get the selected indices of sap.m.Table
var aContexts = myTable.getSelectedContexts(true);
for(var i = 0 ; i < aContexts.length ; i++)
var selectedIndex = parseInt(aContexts[i].sPath .split("/")[2]);
Thanks,
Rumeshbabu S -
How to get the selected value in SelectOneMenu in backing bean
Hello all,
I need your help. I want to have 2 select menus with the second menu's items list are populated based on the selection in the first menu. I don't know how to get the selected value in the backing bean so that I can based on that select menu to populate the second menu's item list. Basically I need to access to the UI Component of the first select Menu and retrieve its selected value.
Could you help me out?
Thank you very much in advance,
LngoHi Lingo,
There r two ways of getting the values into the list. First one is hardcoding the values and the second one is use the list and get the values into the list by firing a query in the database.
Inorder to display the values in the second menu based on the first onces selection we need to add an attribute to the first selectonemenu known as valueChangeListener and we need to sumit the page.
Here is the sample code
<h:selectOneMenu id="catalogue"
binding="#{urbean.catalogue}" onchange="submit()"
valueChangeListener="#{urbean.categoryValueChange}"
<f:selectItem itemLabel="Select Catalogue" itemValue="" />
<f:selectItems value="#{urbean.catalogueList}" />
</h:selectOneMenu>
<h:selectOneMenu id="category"
binding="#{urbean.category}"> <f:selectItem itemLabel="Select Category" itemValue="" />
<f:selectItems value="#{urbean.categoryList}" />
< </h:selectOneMenu>
now in method called by valuechangelistener we need to write the similar code
public void categoryValueChange(ValueChangeEvent event) {
String rfnum = (String) event.getNewValue();
List categoryList = new ArrayList();
List tempList = new TablenameDAO().getActiveCatByCatalogueID(rfnum);
for (int i = 0; i < tempList.size(); i++) {
Tablename tablename = (Tablename ) tempList.get(i);
String value = "" + tablename .getrfnum();
String label = tablename .getname();
if (label == null) {
label = "";
SelectItem item = new SelectItem(value, label);
categoryList.add(item);
bean.setCategoryList(categoryList);
///getActiveCatByCatalogueID (rfnum) should bring the records which r based on the rfnum
if u follow this process i am damsure that u will get the values in to the secondlist based upon the first list
Thanks & Regards
Manidhar
Maybe you are looking for
-
I just was given a I Book G3 - So, I have booted it up and checked it all out and then reached a point to where I need information. For some reason I can't tell what the operating system is. Even on my G4 PPC I couldn't tell you if I have Leopard, Ti
-
I have the latest nano,but when the battery shows red or low battery the sound only comes out of one earphone (left side),is this normal or do i have a problem.
-
Installing Firefox on my computer
I can't download, let alone actually install firefox. After I select save, a box appears asking whether I wish to do this as the administrator, asking for a password, or as myself. I select myself, the box goes away, as does the whole download proces
-
DIFFERENT FIGURE SHOWN IN FMEM REPORT COMPARED TO GL FOR GL CODE
Dear gurus, when i am comparing G/L accounts and FMEM reports that not tallying for particular G/L accounts only,for that i had checked maping with g/l accounts and commitment item and funds management .but i am not getting where it is wrong.
-
I have a HP C7280 all in one. They don't sell and I don't have the ink for it. I do want to use it as a fax machine and or scanner. Is it possible to bypass all of the messages about expired and empty ink to use these featuers in a non-print mode?