Access the selected values from grid
I want to select vendor from the list.For this I have loaded vendor list in grid.How to get the value of selected vendor into variable ? For this I have used following code-
Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent
Dim dtgGrid As SAPbouiCOM.Grid
Dim strVendorCode As String
Dim strVendorName As String
Dim dtgRows As SAPbouiCOM.GridRows
Dim dtgColumns As SAPbouiCOM.GridColumns
Try
If pVal.EventType = SAPbouiCOM.BoEventTypes.et_CLICK And pVal.Before_Action = True And pVal.ItemUID = "dtgGrid" Then
dtgGrid = SBO_Application.Forms.ActiveForm.Items.Item("dtgGrid").Specific
dtgGrid.Rows.SelectedRows.Add(pVal.Row)
strVendorCode = dtgGrid.Rows.SelectedRows.Item(1, SAPbouiCOM.BoOrderType.ot_RowOrder)
strVendorName = dtgGrid.Rows.SelectedRows.Item(1, SAPbouiCOM.BoOrderType.ot_SelectionOrder)
End If
Catch ex As Exception
SBO_Application.MessageBox(ex.Message)
End Try
End Sub
But I could not get the value in the variable strVendorName .
Hi,
i would access value with the datatable
something like:
oForm = SBOApplication.Forms.Item(FormUID)
oGrid = oForm.Items.Item("grid").Specific
oGrid.DataTable.Columns.Item("insertthecolumnname").Cells.Item(i).Value
regards
David
Similar Messages
-
How can I access the Attribute Values from the Search Region
Hi all,
I have a table which contains Company id, department id, and PositonId. For a particular Company and Department there may be multiple records.
I have to pupulate a table which contains the position and other details that comes under a particular Department and Position based on the selection in the Three comboBoxes.
Also I have to populate a select many Shuttle to add new postions and records under a particular Department.
I created a query panel *(Search Region)* for the serch and a table to display the data. That is working fine.
Now the issue is I am using a view criteria to populate the shuttle with two bind variables ie, DepartmentId and CompanyId.
If the serach will return a resuktant set in the table it will also pupulate the correct records, otherwise ie, if the if the serch result is empty the corresponding iterator and the attribute is setting as null.
SO I want to access the attribute values from the Search Region itsef to populate the shuttle.
I don't know how can I access the data from the Search Region.
Please Help.
Regards,
Ranjithyou could access the parameters entered in search region by the user as follows:
You can get handle to the value entered by the user using queryListener method in af:query.
You can intercept the values entered as described
public void onQueryList(QueryEvent queryEvent) {
// The generated QueryListener replaced by this method
//#{bindings.ImplicitViewCriteriaQuery.processQuery}
QueryDescriptor qdes = queryEvent.getDescriptor();
//get the name of the QueryCriteria
System.out.println("NAME "+qdes.getName());
List<Criterion> searchList = qdes.getConjunctionCriterion().getCriterionList();
for ( Criterion c : searchList) {
if (c instanceof AttributeCriterion ) {
AttributeCriterion a = (AttributeCriterion) c;
a.getValues();
for ( Object o : a.getValues()){
System.out.println(o.toString());
//call default Query Event
invokeQueryEventMethodExpression("#{bindings.ImplicitViewCriteriaQuery.processQuery}",queryEvent);
public void onQueryTable(QueryEvent queryEvent) {
// The generated QueryListener replaced by this method
//#{bindings.ImplicitViewCriteriaQuery.processQuery}
QueryDescriptor qdes = queryEvent.getDescriptor();
//get the name of the QueryCriteria
System.out.println("NAME "+qdes.getName());
invokeQueryEventMethodExpression("#{bindings.ImplicitViewCriteriaQuery.processQuery}",queryEvent);
private void invokeQueryEventMethodExpression(String expression, QueryEvent queryEvent){
FacesContext fctx = FacesContext.getCurrentInstance();
ELContext elctx = fctx.getELContext();
ExpressionFactory efactory = fctx.getApplication().getExpressionFactory();
MethodExpression me = efactory.createMethodExpression(elctx,expression, Object.class, new Class[]{QueryEvent.class});
me.invoke(elctx, new Object[]{queryEvent});
Thanks,
Navaneeth -
How to capture the selected values from module pool dialog list box !
Hi experts,
Can anyone help me out in capturing the values from the list box.
i am able to set the values in the list box.But i am not able to capture the selected value from the list box. Always the list box name is getting as "space"
I also tried in using the FM "VRM_GET_VALUES" but it is retireving all the values. Is there is any flag for filttering out the selected value.
Your inputs are appreciated.
Thanks,
Vijay.Along with the PBO and PAI event, add a POV event in the flow logic of the screen
DEMO_DROPDOWN_LIST_BOX -is a good demo example.
PROCESS ON VALUE-REQUEST.
FIELD structure_name-field_name MODULE create_dropdown_box.
In the report :
MODULE create_dropdown_box INPUT.
SELECT carrid carrname
FROM scarr
INTO CORRESPONDING FIELDS OF TABLE itab_carrid.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'CARRID'
value_org = 'S'
TABLES
value_tab = itab_carrid
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
ENDIF.
ENDMODULE.
In the layout, assign a Function Code , for eg : 'SELECTED' to the listbox and lets say name of the field is SDYN_CONN-CARRID. So in the PAI module,
MODULE user_command_0100 INPUT.
CASE ok_code.
WHEN 'SELECTED'.
MESSAGE i888(sabapdocu) WITH sdyn_conn-carrid.
ENDCASE.
ENDMODULE.
sdyb_conn-carrid will contain your selected field -
Hi all,
I am making a vi where I have to save the selected value from listbox with its respective tab control dropdown selcted values in another listbox.Whenever I select Item1 then the heading change and respective tab will open for that item.But Now I just want to save the selection and put it in another ListBox.SO that I can renmove or add according to my wish. Plz help me.
Solved!
Go to Solution.
Attachments:
my_vi.png 83 KBHi, I successfully make the vi to insert itmes from listbox1 to listbox2.Whenever I select itmes 1 in listbox 1 it display same elected item in listbox2 , but it not appending the items in listbox2.Like If 1 is selected in listbox1 then 1 will display , next time after saving when I selct next item like 3 then in listbox 2, 1 is replaced by 3,it dont come in second row of listbox2.Hope I am able to explain.\
Plz help me to resolve this.
Attachments:
listbox_update.vi 11 KB -
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 to get the selected values from multiselected list
Hi,
I have a multiselect list displaying all the years from 2003 to 2008 (used dynamic LOV). The user can choose one or more years as per his needs, and then when user clicks on the link the selected values of the list are to be captured and a pop up page of a Discoveror report needs to be opened where these years get passed as a parameter. I tried several methods to capture the value, but either one or all are getting passed but not exactly what the user has chosen.
This is how it looks:
P2_FISCAL_YEAR is a multiselect list containing values from 2003,2004... 2008
If user chooses 2004 and 2007
then I want the url to capture these values and pass as parameters for my discoveror reports. as '&qp_fiscal_year=2004,2007'
Any help is appreciated!
Thanks in advance,
Sapna.Hi,
I have a multiselect list displaying all the years from 2003 to 2008 (used dynamic LOV). The user can choose one or more years as per his needs, and then when user clicks on the link the selected values of the list are to be captured and a pop up page of a Discoveror report needs to be opened where these years get passed as a parameter. I tried several methods to capture the value, but either one or all are getting passed but not exactly what the user has chosen.
This is how it looks:
P2_FISCAL_YEAR is a multiselect list containing values from 2003,2004... 2008
If user chooses 2004 and 2007
then I want the url to capture these values and pass as parameters for my discoveror reports. as '&qp_fiscal_year=2004,2007'
Any help is appreciated!
Thanks in advance,
Sapna. -
Accessing the email value from the iPhone AddressBook
Need some help getting the email value from the AddressBook. This is what I have so far ...
Used to open up the picker and limit to email only
-(void) browseButtonPressed:(id)sender
ABPeoplePickerNavigationController* controller = [[ABPeoplePickerNavigationController alloc] init];
controller.peoplePickerDelegate = self;
NSNumber* emailProp = [NSNumber numberWithInt:kABPersonEmailProperty];
controller.displayedProperties = [NSArray arrayWithObject:emailProp];
controller.navigationBar.tintColor = [UIColor blackColor];
[self presentModalViewController:controller animated:YES];
The delegate method in the same class
- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker
shouldContinueAfterSelectingPerson:(ABRecordRef)person
property:(ABPropertyID)property
identifier:(ABMultiValueIdentifier)identifier
NSString *email = (NSString *)ABRecordCopyValue(person, kABPersonEmailProperty);
NSLog(@"selected person: %@", email);
[[peoplePicker parentViewController] dismissModalViewControllerAnimated:YES];
return NO;
The NSLog prints the following ...
selected person: <NSCFType: 0x1d81c0>
Any idea why it's not printing a string rather I am getting NSCFType ?Great Post. One of the few times that I was able to come to a conclusion about the code I need. Here is an example of the delegate method in reference to getting the email address.
- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier
ABMultiValueRef emails = ABRecordCopyValue(person, property);
CFStringRef email = ABMultiValueCopyValueAtIndex(emails, identifier);
NSLog( (NSString *) email);
self.receiverEmail.text = (NSString *) email;
[self.tabBarController dismissModalViewControllerAnimated:YES];
return NO;
} -
Need to get the selected values from the selectManyShuttle
Hi,
I am using ADF11g newer version.
I have a selectManyShuttle and a command button. Need to insert all the selected values on the right hand side of the selectManyShuttle into a database table.
I created the selectManyShuttle with the values. Need help in getting the values on the right hand side.
<af:selectManyShuttle value="#{bindings.UserMgmtVO1.inputValue}"
id="sms2">
<f:selectItems value="#{bindings.UserMgmtVO1.items}"
id="si6"/>
</af:selectManyShuttle>
Any sample code or link is really appreicated.
ThanksThanks for the reply.
I am using a View Object and I dropped it as SelectManyShuttle
<af:selectManyShuttle value="#{bindings.UserMgmtVO1.inputValue}"
id="sms2"
valueChangeListener="#{POBacking.getSelectedValues}"
valuePassThru="true"
autoSubmit="true">
<f:selectItems value="#{bindings.UserMgmtVO1.items}"
id="si6"/>
</af:selectManyShuttle>
public void getSelectedValues(ValueChangeEvent valueChangeEvent) {
System.out.println("Testing Shuttle");
ArrayList list = new ArrayList(Arrays.asList(valueChangeEvent.getNewValue()));
String val = "";
String sqlStmt = "";
try {
if (list != null) {
for (int i = 0; i < list.size(); i++) {
int l = list.size() - 1;
val = list.get(l).toString(); //returns , delimited string
System.out.println(" value:" + val);
if (val != null) {
val = val.replaceAll("[\\[\\]]", ""); //remove []
StringTokenizer st = new StringTokenizer(val, ",");
int nto = st.countTokens();
for (int j = 0; j < nto; j++) {
String users = st.nextToken().trim();
System.out.println("Users:" + users);
//sqlStmt = " update xxpp_project_clip set clip_status='true', clip_seq = "+j * 10+
// " where project_id = "+rHdr.getAttribute("ProjectId") +
// " and clip_name ='"+ clip_Name +"'";
//System.out.println("sqlStmt:" + sqlStmt);
//stmt.executeUpdate(sqlStmt);
//am.getDBTransaction().commit();
//if (stmt != null)
// stmt.close();
// am.getDBTransaction().commit();
} catch (Exception ex) {
ex.printStackTrace();
I don't see the values in the list.
I gets printed as
value:[Ljava.lang.Integer;@1b10691
Users:Ljava.lang.Integer;@1b10691
how to get the individual values in the list?
Thanks
Saru -
How to get the selected values from the shuttle
Hi
Please tell me how to get the selected option values from the shuttle leading list.
Thanksyou can also obtain the option values present in the leading and trailing lists using the
following methods:
public String[] getLeadingListOptionValues(OAPageContext pageContext, OAWebBean
webBean)
public String[] getTrailingListOptionValues(OAPageContext pageContext, OAWebBean
webBean)For example, the following code sample returns an array of values in the trailing list, ordered according to the
order in which they appear in the list:
String[] trailingItems =
shuttle.getTrailingListOptionValues(pageContext, shuttle);Thanks
--Anil -
How to get the selected values from ADF select many shuttle to textfield
Hi All
Actually in my webpage, I am using text field and beside that placing the command button. When user clicks the command button, a popup window will open up with the "af:select many shuttle" component. While popup opens, it fetch the values backend and displays it to the user in left side of the component. When user selects few values to the right side of the component and clicks ok. Those selected values should be displayed in the besides inputtext field.
Code in Webpage:
<af:inputText id="disciplineVariable"
contentStyle="width:200px;"
styleClass="AFDefaultBoldFont;AFLabelTextForeground;AFDarkForeground;"
value="#{ADFStandards.input}"/>
<af:commandImageLink id="cb12" icon="/compliance/images/List.PNG" hoverIcon="/compliance/images/HoverList.PNG">
<af:clientListener type="action" method="disciplinePopupMethod"/>
</af:commandImageLink>
PopUp code:
<af:popup id="testingPopUP" contentDelivery="lazyUncached">
<af:dialog title="TestingPOPUP" dialogListener="#{testBean.testingValues}">
<af:selectManyShuttle id="sms1" valueChangeListener="#{testBean.testingPopUP}">
<f:selectItems value="#{ADFStandards.mostCommonStandards}" id="si1"/>
</af:selectManyShuttle>
</af:dialog>
</af:popup>
Could anyone please help me in this.
Regards
Venkat.SBind your value attribute for af:selectManyShuttle to the List property in ManagedBean. When the User finish the selection, in your MB set the attribute List in input string attribute (probably what you want is iterate over the list, and concatenate on the String). After that, you have to partialTriggers on the inputText component in order to refresh.
Regards, -
How to Retrieve the Selected Values from selectOrderShuttle using ADF 11g
Hi Every One,
Does anyone has idea how to retrieve the selected Items using shuttle and Order of the items using 'SelectOrderShuttle' component ?
Thanksshuttle's valuechangeevent would fire when you shuttle items back and forth.
public void selectOrderShuttle1_valueChangeListener(ValueChangeEvent valueChangeEvent) {
ArrayList list = new ArrayList(Arrays.asList(valueChangeEvent.getNewValue()));
if (list != null){
for (int i=0; i<list.size(); i++) {
int l = list.size()-1;
val = list.get(l).toString(); //returns , delimited string
if (val != null){
val = val.replaceAll("[\\[\\]]", "");
StringTokenizer st = new StringTokenizer (val, ",");
int nto = st.countTokens ();
for (int j = 0; j < nto; j++)
String token = st.nextToken ();
.......... -
Accessing Selected Value from Payment Terms (Item 47) in AR Invoice Form
Hi,
Have just started working in SAP Business One and SDK adn would really appreciate any help I could receive.
I'm trying to access the selected value from Payment Terms field(Item 47) in the AR Invoice Form.
Have successfully managed to do this against Customer Code field using the following code-:
Private Sub eventHandlerTest(ByVal FormUID As String, pVal As SAPbouiCOM.ItemEvent, BubbleEvent As Boolean)
Dim frm As SAPbouiCOM.Form
Dim itmCustomer As SAPbouiCOM.Item
Dim edtCustomer As SAPbouiCOM.EditText
Dim itmRemark As SAPbouiCOM.Item
Dim edtRemark As SAPbouiCOM.EditText
Dim FieldNo As String
Set frm = SBO_Application.Forms(FormUID)
Set itmCustomer = frm.Items(pVal.ItemUID)
Set edtCustomer = itmCustomer.Specific
If UCase(edtCustomer.Value) = "CALECH1" Then
FieldNo = "16"
Set itmRemark = frm.Items(FieldNo)
Set edtRemark = itmRemark.Specific
edtRemark.String = "E"
End If
End Sub
However when doing the same thing for Payment Terms I get the error "Run-time error '13': type mismatch" on the line
Set edtOrderType = itmOrderType.Specific
ThanksHi,
On the new invoice's form item 47 is ComboBox and I guess it's stay in the same type when you open existing invoice. So try to work with this item like with ComboBox. But if you need only get some information about existing invoice, you don't need to fork with the screen objects - you can get all you need from the DI Document object. Open Document object with Invoice type, find invoice and check PaymentGroupCode property.
Best regards,
Mark -
How t print out selected values from a Jlist
hi iam trying to get the selected values from a list to print out as a string but iam getting ,Invalid cast from java.lang.Object[] to java.lang.String.is there any way to get the selected values t print ut as a string?? import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class MultipleSelection2 extends JFrame {
private JList colorList, copyList;
private JButton copy;
private String colorNames[] =
{ "Black", "Blue", "Cyan", "Dark Gray", "Gray",
"Green", "Light Gray", "Magenta", "Orange", "Pink",
"Red", "White", "Yellow" };
public MultipleSelection2()
super( "Multiple Selection Lists" );
Container c = getContentPane();
c.setLayout( new FlowLayout() );
colorList = new JList( colorNames );
colorList.setVisibleRowCount( 5 );
colorList.setFixedCellHeight( 15 );
colorList.setSelectionMode(
ListSelectionModel.MULTIPLE_INTERVAL_SELECTION );
c.add( new JScrollPane( colorList ) );
// create copy button
copy = new JButton( "Copy >>>" );
copy.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent e )
// place selected values in copyList
copyList.setListData(
colorList.getSelectedValues());
String s1 =(String)colorList.getSelectedValues();Since the JList method 'getSelectedValues' returns an object array you'll need to iterate through the array and cast each object in the array to a string as you access them.
Object[] o = colorList.getSelectedValues();
for(int count=0,end=o.length; count<end; count++) {
String s = (String) o[count];
Hope that helps
Talden -
Getting selected values from selectManyChoice component inside valueChangeListener
Hwo do I get the selected values from the selectManyChoice component inside the valueChangeListener.
The API docs for valueChangeEvent.getNewValue() show the return type as java.lang.object. This is good for single value what does it return in case of multiple values.
My drop down has string values so I am expecting a set of string values.JDev - 11.1.2.3
public void onRegionSelect(ValueChangeEvent event) {
event.getComponent().processUpdates(FacesContext.getCurrentInstance());
if (!PhaseId.INVOKE_APPLICATION.equals(event.getPhaseId())) {
event.setPhaseId(PhaseId.INVOKE_APPLICATION);
event.queue();
} else {
List<Object> values = Arrays.asList(event.getNewValue());
System.out.println("Value changed ==>> "+values.size());
DCBindingContainer dc =
(DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding iter = dc.findIteratorBinding("RegVO1Iterator");
ViewObject vo = iter.getViewObject();
StringBuffer regions = new StringBuffer();
for(Object index : values){
String iIndex = (String)index;
Row row = vo.getRowAtRangeIndex(Integer.parseInt(iIndex));
regions.append((String)row.getAttribute("Region")+",");
String reg = regions.toString();
if(reg.endsWith(","))
reg = reg.substring(0,reg.lastIndexOf(","));
System.out.println(reg); -
Select value from dropdown list
hi All,
we have a bsp application MVC based, we have a dropdown list, what we require is when user selects an entry from drop down list and presses a button, we want to select that value from drop down list and then pass it to the method that will be called when button is pressed event..
I want to know two things
1. How do i get the selected value from dropdown ?
2. hw can i retain it to send it to method call in handle_event bit
thank you allHi,
If your application is stateless you have to capture the selected value in do_handle_data and assign it to the controller class attribute and later use this value in do_handle_event directly.
If your application is stateful, on your dropdownlist htmlb tag click F1 you can read the documentation which also shows how to capture the value of dropdownlist in do_handle_event. In the same documentation you can even find few samples provided and check those samples in your system.
Hope this helps.
Regards,
Abhinav
Maybe you are looking for
-
USR user defined field in OIM design console in not visible
Hi all, We have OIM setup in the environment and wanted to add some custom attributes for USR user defined field definition. When I open the User Defined Field Definition tab, I could not see USR form. When I tried to export specific users from OIM j
-
Can't generate a new 2FA recovery key
I'm trying to create a new recovery key and each time I press the activate button I just get taken to an error page. http://i.imgur.com/5hc4hCt.png Called Apple support and they don't know what's going on. I'm not even sure they really understood wha
-
How to upgrade Apache 1.2.22 - 1.3.33, Oracle 9i
I have to upgrade Apache to newer version for security reason. I'm running Oracle 9i database release 2 (9.2.0.1.0). I just got 20+ pages report what needs to be fixed and this should fix most problems. I just made clean install on test machine. Can
-
Hy, everybody. I've made an EXE from my Labview-application. It works fine, but after stopping this, the window stays on the desktop. I have to close this window by hand (Alt-F4, File-Close or so). Can i set some prarameters to force LabView make thi
-
How do i turn my speaker up when on facetime?
Whenever I go to face time somebody, I can hear them perfectly fine but they can never hear me. Why is that? And how do I fix it?