Reading selected values from af:selectManyListbox

Hi
got af:selectManyListbox in the page with the dept_id as the base attribute and dept_name as the display attribute.
Since its multi select i'm able to read the selected values using array as per the following code
            BindingContext bc1 = BindingContext.getCurrent();
            DCBindingContainer binding1 = (DCBindingContainer)bc1.getCurrentBindingsEntry();
                JUCtrlListBinding listBindings1 = (JUCtrlListBinding)binding1.get("DEPTVIEW1");     
                Object str[] = listBindings1.getSelectedValues();
                System.out.println("after  Object str[] = listBindings1.getSelectedValues();");
                for (int i = 0; i < str.length; i++) {
                    System.out.println(str[i]);
which is returning the dept_id s since its the base attribute
say
2
3
6
on basis of selection
I got to retrieve the DEPT_NAME too?
How to fetch the DEPT_NAME which is the display attribute??
Bindings has the DEPTVIEW1 in the variables. so i cant separately access the DEPT_NAME too from bindings.
Thanks
Chaya

Hey chaya,
I use a similar method of what you use, but i use it with selectionEvents but take a look at my code and see if it can help you:
        //get access to the master table to read selected row keys
        RichTable rt = (RichTable) selectionEvent.getSource();
        RowKeySet rks = rt.getSelectedRowKeys();
        while (selectedRowsIterator.hasNext()) {
            List rowKey = (List) selectedRowsIterator.next();
            //make the row current
            rt.setRowKey(rowKey);
            JUCtrlHierNodeBinding wrappedRow = (JUCtrlHierNodeBinding) rt.getRowData();
            Row rw = wrappedRow.getRow();
            long var_dimCoinInt = (Long) rw.getAttribute("PkCoin");
regards,
Frederico.

Similar Messages

  • Unable to read selected values from selectManyListbox control

    I have selectManyListbox component in my jsp page as follows:
    <h:selectManyListbox id="allBusinessFunctions" styleClass="maintxtbox selectCampaignBox" >
    <f:selectItems value="#{pc_CreateCampaigns.bizFunctions}"/>
    </h:selectManyListbox>
    I am doing multiple selections on the component. In the same jsp page I have graphicImage component as follows:
    <h:graphicImage id="createCampaignLink" alt="Click on this" url="/theme/img/button-use.gif">
    <hx:behavior event="onclick" behaviorAction="get" targetAction="bizFunDetailsGroup"></hx:behavior>
    </h:graphicImage>
    On click of this graphicImage I am invoking a ajax call to one of the backing bean method getDisplayBizFunctions().
    I also have a panel group component as follows:
    <h:panelGroup id="bizFunDetailsGroup" styleClass="panelGroup">
    <h:dataTable id="bizFunDetails" value="#{pc_CreateCampaigns.displayBizFunctions}" var="bizFunctions" border="0">
    <h:column>
    <f:facet name="header">
         <h:outputText value="Column1"/>
    </f:facet>
    <h:outputText value="#{bizFunctions}"/>                                        
    </h:column>
    </h:dataTable>
    </h:panelGroup>
    <hx:ajaxRefreshRequest id="ajaxRefreshRequest3" target="bizFunDetailsGroup" params="allBusinessFunctions"></hx:ajaxRefreshRequest>
    In my backing bean I have a method as follows:
    public ArrayList getDisplayBizFunctions(){                         
    bizTypeSearch = (String)getRequestParam().get("allBusinessFunctions");
    System.out.println("bizTypeSearch =" + bizTypeSearch );                         
              return null;
    I am trying to read the multiple selected values of as
    getRequestParam().get("allBusinessFunctions");
    Which is returing only the first selected items value but not all..
    How can get all the selected values?

    To the point: you should have used HttpServletRequest#getParameterValues(), not getParameter().
    In this specific case: just bind the <h:selectManyListbox> 'value' property with a List<BizFunctionType> property in the backing bean.

  • 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-
    Abhijit

    Hi 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

  • Read selected values from a multi choice field programatically using Microsoft.SharePoint.Client namespace.

    All examples I found refer to classes under Microsoft.SharePoint namespace. However, I have the SharePoint CSOM that only gives me the Microsoft.Sharepoint.Client namespace.
    I need to read the selected values of a multichoice field, but not sure how to do it with classes in the namespace above.
    everthing works, exept the TSQL_x0020_Reference_x0020_Numbe field.
    my code looks like this:
    Webweb = cont.Web;
                cont.Load(web);
                cont.ExecuteQuery();
    Listsstest = web.Lists.GetByTitle("T-SQL
    Code Review Tracking");
    //CamlQuery query = CamlQuery.CreateAllItemsQuery();
    CamlQueryquery =
    newCamlQuery();
                query.ViewXml =
    @"<View>
                               <ViewFields>
                                    <FieldRef Name='Category'/>
                                    <FieldRef Name='Review_x0020_Type'/>
                                    <FieldRef Name='Review_x0020_Start_x0020_Date'/>
                                    <FieldRef Name='Title'/>
                                    <FieldRef Name='Location'/>
                                    <FieldRef Name='Project'/>
                                    <FieldRef Name='Author0'/>
                                    <FieldRef Name='AssignedTo'/>
                                    <FieldRef Name='TSQL_x0020_Reference_x0020_Numbe'/>
                                </ViewFields>
                             </View>"
     ListItemCollectionitems
    = sstest.GetItems(query);
                cont.Load(items);
                cont.ExecuteQuery();
    foreach(ListItemitem
    initems)
                    Output0Buffer.AddRow();
                    Output0Buffer.ReviewStatus = item.FieldValues[
    "Category"] !=
    null? item.FieldValues["Category"].ToString()
    : String.Empty;
                    Output0Buffer.ReviewType = item.FieldValues[
    "Review_x0020_Type"] !=
    null? item.FieldValues["Review_x0020_Type"].ToString()
    : String.Empty;
                    Output0Buffer.ReviewDate =
    DateTime.Parse(item.FieldValues["Review_x0020_Start_x0020_Date"].ToString());
                    Output0Buffer.Module = item.FieldValues[
    "Title"] !=
    null? item.FieldValues["Title"].ToString()
    : String.Empty;
                    Output0Buffer.BranchLocationURL = item.FieldValues[
    "Location"] !=
    null? item.FieldValues["Location"].ToString()
    : String.Empty;
                    Output0Buffer.ProjectName = item.FieldValues[
    "Project"] !=
    null? item.FieldValues["Project"].ToString()
    : String.Empty;
                    Output0Buffer.Author = item.FieldValues[
    "Author0"] !=
    null? item.FieldValues["Author0"].ToString()
    : String.Empty;
    FieldLookupValueflvAssignedTo =
    newFieldUserValue();
                    flvAssignedTo = item.FieldValues[
    "AssignedTo"]
    asFieldLookupValue;
    if(flvAssignedTo !=
    null)
                        Output0Buffer.AssignedTo = flvAssignedTo.LookupValue;
    varv = item.FieldValues["TSQL_x0020_Reference_x0020_Numbe"];
    if(v !=
    null)
                        Output0Buffer.Reason2 = v.ToString();
                 Output0Buffer.SetEndOfRowset();           

    Hi,
    According to your description, my understanding is that you want to read the selected choice field value using Client Object Model.
    In my environment, I create a list with a mutichoice fileld named "choice" and then I used the code snippet below to get the selected value in choice field.
    ClientContext clientContext = new ClientContext("http://sp2013sps/sites/test1");
    Microsoft.SharePoint.Client.List spList = clientContext.Web.Lists.GetByTitle("list1");
    clientContext.Load(spList);
    clientContext.ExecuteQuery();
    if (spList != null && spList.ItemCount > 0)
    Microsoft.SharePoint.Client.CamlQuery camlQuery = new CamlQuery();
    camlQuery.ViewXml =
    @"<View>
    <ViewFields><FieldRef Name='choice' /></ViewFields>
    </View>";
    ListItemCollection listItems = spList.GetItems(camlQuery);
    clientContext.Load(listItems);
    clientContext.ExecuteQuery();
    string value = listItems[0]["choice"].ToString();
    Console.WriteLine(value);
    Console.ReadKey();
    Thanks
    Best Regards
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How to get selected value from selectOneRadio ???

    Hi...i want to how to get selected value from selectOneRadio and use it in another page and in backing bean.
    Note i have about 10 selectOneRadio group in one page i want to know value of each one of them.
    Plzzzzzzzz i need help

    You have a datatable in which each row is a question, correct?
    Also in each row you have 5 possible answers that are in a radio, correct?
    So,
    You need to put in your datatable model, a question, and a list of answers (5 in yor case) and the selected one.
    So you will have a get to the question, an SelectItem[] list to populate the radios and another get/set to the selected question.
    ex:
    <h:selectOneRadio value="#{notas.selectedString}" id="rb">
    <f:selectItem itemValue="#{notas.valuesList}"/>
    </h:selectOneRadio>
    Search the web for examples like yours.

  • How to get selected value from OADefaultListBean.

    Hi All,
    How to get selected value from OADefaultListBean ?
    Thanks,

    Hi,
    To identify the user's selection(s) when the page is submitted, you would add the following logic to your processFormRequest() method:
    OADefaultListBean list =
    (OADefaultListBean)webBean.findChildRecursive("positionsList");
    String name = list.getName();
    String[] selectedValues = pageContext.getParameterValues(name);
    To retrieve all the values in the list box, call list.getOptionsData().
    --Prasanna                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • 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);

  • Copy selected values from a table control into another table control

    hi there,
    as seen in the subject i need to copy selected values from a table control into another table control in the same screen. as i dont know much about table controls i made 2 table controls with the wizard and started to change the code... right now im totally messed up. nothing works anymore and i don't know where to start over.
    i looked up the forums and google, but there is nothing to help me with this problem (or i suck in searching the internet for solutions)
    i have 2 buttons. one to push the selected data from the top table control into the bottom tc and the other button is to push selected data from the bottom tc into the top tc. does somebody has a sample code to do this?

    you're funny
    i still don't get it... can't believe, there is no tutorial or sample code around how to copy multiple selected rows from a tc.
    here's my code, maybe you can tell me exactly were i have to change it:
    tc1 = upper table control
    tc2 = lower table control
    SCREEN 0100:
    PROCESS BEFORE OUTPUT.
      MODULE status_0100.
      MODULE get_nfo. --> gets data from the dictionary table
      MODULE tc1_change_tc_attr.
      LOOP AT   it_roles_tc1
           INTO wa_roles_tc1
           WITH CONTROL tc1
           CURSOR tc1-current_line.
      ENDLOOP.
      MODULE tc2_change_tc_attr.
      LOOP AT   it_roles_tc2
           INTO wa_roles_tc2l
           WITH CONTROL tc2
           CURSOR tc2-current_line.
      ENDLOOP.
    PROCESS AFTER INPUT.
      LOOP AT it_roles_tc1.
        CHAIN.
          FIELD wa_roles_tc1-agr_name.
          FIELD wa_roles_tc1-text.
        ENDCHAIN.
        FIELD wa_roles_tc1-mark
          MODULE tc1_mark ON REQUEST.
      ENDLOOP.
      LOOP AT it_roles_tc2.
        CHAIN.
          FIELD wa_roles_tc2-agr_name.
          FIELD wa_roles_tc2-text.
        ENDCHAIN.
        FIELD wa_roles_tc2-mark
          MODULE tc2_mark ON REQUEST.
      ENDLOOP.
      MODULE ok_code.
      MODULE user_command_0100.
    INCLUDE PAI:
    MODULE tc1_mark INPUT.
      IF tc1-line_sel_mode = 2
      AND wa_roles_tc1-mark = 'X'.
        LOOP AT it_roles_tc1 INTO g_tc1_wa2
          WHERE mark = 'X'.    -
    > big problem here is, that no entry has an 'X' there
          g_tc1_wa2-mark = ''.
          MODIFY it_roles_tc1
            FROM g_tc1_wa2
            TRANSPORTING mark.
        ENDLOOP.
      ENDIF.
      MODIFY it_roles_tc1
        FROM wa_roles_tc1
        INDEX tc1-current_line
        TRANSPORTING mark.
    ENDMODULE.                    "TC1_MARK INPUT
    MODULE tc2_mark INPUT.
      IF tc2-line_sel_mode = 2
      AND wa_roles_tc2-mark = 'X'.
        LOOP AT it_roles_tc2 INTO g_tc2_wa2
          WHERE mark = 'X'.             -
    > same here, it doesn't gets any data
          g_tc2_wa2-mark = ''.
          MODIFY it_roles_tc2
            FROM g_tc2_wa2
            TRANSPORTING mark.
        ENDLOOP.
      ENDIF.
      MODIFY it_roles_tc2
        FROM wa_roles_tc2
        INDEX tc2-current_line
        TRANSPORTING mark.
    ENDMODULE. 
    thx for anybody who can help with this!

  • How do I pass selected values from dynamic LOV to Command SQL in Oracle

    My environment:
    Crystal 11
    Oracle 10
    I've created and tuned a SQL script for a report.  In the Database Expert, I've copied the SQL into a Command.   I've modified the Command to create 3 parameters. 
    I need help with the following:
    1) How do I create a dynamic, cascading LOV and associated prompt group for the three parameters defined in the Command?
    2) How do I pass the user selected valueS from the prompt group into the Command SQL as limits applied to the query executed against the database?

    I have the same problem with same environment .
    The main report is having a  2 level cascading dynamic parameters.
    I created a sub report with a command as below.
    *select * from (*
    select DATUM,MSEC,CNT,B1_NAME,B2_NAME,B3_NAME,ELEM_NAME,INFO_NAME,m.INFOTYPE,V.NAME,rank()
    over (partition by B1_NAME,B2_NAME,B3_NAME order by DATUM desc ,MSEC desc,CNT desc) currentRank
    from MESSAGES m,INTYDE i,VANAME v
    where  DATUM <=SYSDATE  and trim(B1_NAME)='{?B1Name}'
    and trim(B2_NAME)='{?B2Name}'
    and m.INFOTYPE=i.INFOTYPE
    and i.VALUE_NAME_NUMBER = v.VALNUM) where currentRank=1
    I needs to pass cmbination of B1Name and B2Name from main report. I created a formula like
    formula=Join({?B1Name},{?B2Name}),'|');  But this is showing some error.
    and How I will substitute this in my command . As I new to Crystal XI  help expected.

  • Error after selecting value from LOV - You are trying to access a page that is no longer active.

    Created a simple page with a few text inputs and 4 LOV. After selecting a value from the last LOV the following error is displayed:
    Error:
    You are trying to access a page that is no longer active.
    - The referring page may have come from a previous session. Please select Home to proceed.
    OA Framework              12.1.3
    Oracle OA Extension    10.1.3 - build 1313
    Any pointers to the cause ?
    Thanks

    [57]:EVENT:[xx.oracle.apps.ap..webui.EngagementCO]:OAF LOG: Event : Call Process Form Data, in: xx.oracle.apps.ap..webui.EngagementCO: Entering Process Form Data
    [57]:EVENT:[xx.oracle.apps.ap..webui.EngagementCO]:OAF LOG: Event : Call Process Form Data, in: xx.oracle.apps.ap..webui.EngagementCO: Entering Process Form Data
    [57]:EVENT:[fnd.framework.webui.OAFormValueHelper]:OAF LOG: Event : Get Attribute Value, in: oracle.apps.fnd.framework.webui.OAFormValueHelper: View:xxEngagementVO1 ,Attribute:VendorId , Return Value without datatype conversion :996
    [58]:EVENT:[fnd.framework.webui.OAFormValueHelper]:OAF LOG: Event : Get Attribute Value, in: oracle.apps.fnd.framework.webui.OAFormValueHelper: View:xxEngagementVO1 ,Attribute:VendorSiteId , Return Value without datatype conversion :60158
    [58]:EVENT:[fnd.framework.webui.OAFormValueHelper]:OAF LOG: Event : Get Attribute Value, in: oracle.apps.fnd.framework.webui.OAFormValueHelper: View:xxEngagementVO1 ,Attribute:BusinessPrincipalId , Return Value without datatype conversion :48375
    [59]:EVENT:[fnd.framework.webui.OAFormValueHelper]:OAF LOG: Event : Get Attribute Value, in: oracle.apps.fnd.framework.webui.OAFormValueHelper: View:xxEngagementVO1 ,Attribute:AttorneyPersonId , Return Value without datatype conversion :37430
    [59]:EVENT:[fnd.framework.webui.OAMessageLovInputHelper]:OAF LOG: Event : Get Attribute Value, in: oracle.apps.fnd.framework.webui.OAMessageLovInputHelper: View:xxEngagementVO1 ,Attribute:Vendor , Return Value without datatype conversion :CLIFFORD CHANCE
    fnd.framework.webui.OAMessageLovInputHelper][60]:EVENT:[fnd.framework.webui.OAMessageLovInputHelper]:OAF LOG: Event : Get Attribute Value, in: oracle.apps.fnd.framework.webui.OAMessageLovInputHelper: View:xxEngagementVO1 ,Attribute:AttorneyName , Return Value without datatype conversion :Bloggs, Mr. Joe
    [60]:UNEXPECTED:[fnd.framework.webui.OAPageContextImpl]:MACCHECK: . Parameter failing validation is :MatterCode. Parameter "MatterCode" failed Validation. Value got from request object is 2435 
    Incoming URL is : /OA_HTML/OA.jsp?page=/xx/oracle/apps/ap/legal/webui/EngagementPG&_ti=752953423&language_code=US&&OAFMID=94470&OAPB=_OAFMID&oapc=16&oas=xSrFYCAbgOaPGVhqpb0-hA.. .
    Current URL is : /OA_HTML/OA.jsp?page=/xx/oracle/apps/ap/legal/webui/EngagementPG&_ti=752953423&language_code=US&&OAFMID=94470&OAPB=_OAFMID&oapc=16&oas=xSrFYCAbgOaPGVhqpb0-hA.. .
    Referer URL is : https://paydev.company.com/OA_HTML/RF.jsp?function_id=48080&resp_id=53189&resp_appl_id=20003&security_group_id=0&lang_code=US¶ms=CtXL5LFdg5E7c.aFPRw7fTZ5STWrUsz9iXF2ByXh3F4&oas=gAqepzP-un4kBOC8NUxtIQ.. .
    HTTP Request Method is : POST
    [62]:ERROR:[fnd.common.Message.auto_log]:FNDFND_FORM_POST_SECURITY_FAILEDYHOMEFND_GLOBAL_PRMPT_HOME
    [62]:ERROR:[fnd.framework.OAException]:You are trying to access a page that is no longer active.
    - The referring page may have come from a previous session. Please select Home to proceed.
    Click on browser Back button and all LOV values are empty on original screen. Try and select value from LOV and after selection:
    [23]:EVENT:[xx.oracle.apps.ap.legal.webui.EngagementCO]:OAF LOG: Event : Call Process Form Data, in: xx.oracle.apps.ap.legal.webui.EngagementCO: Entering Process Form Data
    [23]:EVENT:[xx.oracle.apps.ap.legal.webui.EngagementCO]:OAF LOG: Event : Call Process Form Data, in: xx.oracle.apps.ap.legal.webui.EngagementCO: Entering Process Form Data
    [23]:UNEXPECTED:[fnd.framework.webui.OAPageContextImpl]:MACCHECK: . Parameter failing validation is :VendorId. Parameter "VendorId" failed Validation. Value got from request object is 996 
    Incoming URL is : /OA_HTML/OA.jsp?page=/xx/oracle/apps/ap/legal/webui/EngagementPG&_ti=752953423&language_code=US&&OAFMID=94470&OAPB=_OAFMID&oapc=17&oas=lC4tbZwHYHffQY6uX7agiA.. .
    Current URL is :  /OA_HTML/OA.jsp?page=/xx/oracle/apps/ap/legal/webui/EngagementPG&_ti=752953423&language_code=US&&OAFMID=94470&OAPB=_OAFMID&oapc=17&oas=lC4tbZwHYHffQY6uX7agiA.. . 
    Referer URL is : https://paydev.company.com/OA_HTML/RF.jsp?function_id=48080&resp_id=53189&resp_appl_id=20003&security_group_id=0&lang_code=US¶ms=CtXL5LFdg5E7c.aFPRw7fTZ5STWrUsz9iXF2ByXh3F4&oas=gAqepzP-un4kBOC8NUxtIQ.. .
    HTTP Request Method is : POST
    [25]:ERROR:[fnd.common.Message.auto_log]:FNDFND_FORM_POST_SECURITY_FAILEDYHOMEFND_GLOBAL_PRMPT_HOME
    [25]:ERROR:[fnd.framework.OAException]:You are trying to access a page that is no longer active.
    - The referring page may have come from a previous session. Please select Home to proceed.

  • Reading any value from table into a string (Especially date etc..)

    How would I read any value from a table into a string?
    Currently doing the following...
    data ret_val type string.
    select single (wa_map-qes_field) from z_qekko into ret_val
    where
    angnr = _angnr.
    When the source field is a date it bombs though.
    The result goes into a BDCDATA-fval.
    regards
    Dylan.

    Tried...
    1    DATA: lp_data TYPE REF TO DATA.
    2    FIELD-SYMBOLS: <value> TYPE ANY.
    3    CREATE DATA lp_data LIKE (wa_map-qes_field).
    4    ASSIGN lp_data->* TO <value>.
    5    SELECT SINGLE (wa_map-qes_field) FROM zquadrem_qekko INTO <value> WHERE angnr = _angnr.
    Complains that (wa_map-qes_field) is not defined in line 3.
    Think that the bracket thing is only available via SQL.
    What about CREATE DATA lp_data type ref to object. ?
    Would the above declaration work?
    regards

  • 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 all

    Hi,
    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

  • Select values from table%ROWTYPE variable into a cursor

    I have a stored procedure which has an OUT parameter of table1%ROWTYPE.
    In future we might have to add more OUT parameters of table2%ROWTYPE etc. But at any point of time only one will have values.
    So instead of having table%ROWTYPE as OUT parameter, can I send these single row ( with variable values) in a cursor, so that declaration part atleast will not change.
    Is it possible to select values from table%ROWTYPE variable into a cursor.
    cursorOUT IS
    SELECT * FROM varREC;
    where varREC is table.ROWTYPE variable.
    Or which is the better solution in this situation.
    Thanks.

    SQL> var a refcursor
    SQL> declare
      2   bb emp%ROWTYPE;
      3  begin
      4   select * into bb from emp where rownum = 1;
      5   open :a for select bb.ename ename, bb.empno empno from dual;
      6  end;
      7  /
    PL/SQL procedure successfully completed.
    SQL> print a
    ENAME                                 EMPNO
    SMITH                                  7369Rgds.

  • About SELECT VALUE FROM NLS_INSTANCE_PARAMETERS WHERE PARAMETER =""

    I am developing a web application based on Oacle 10g .But after the DBServe was startedup for about 5~6 hours, the max connection process exceeded. From the DB Administration Tool it shows that there were many INACTIVE Connections which executed
    SELECT VALUE FROM NLS_INSTANCE_PARAMETERS WHERE PARAMETER ='NLS_DATE_FORMAT'
    But it seems that this is called by the JDBC driver, not my application. How to avoid this, or release the inactive connection?
    By the way,who and when call that sql?
    Thanks a lot.

    By the way,who and when call that sql?Also for this you can take an 10046 level 8 sql trace and format the output with sys=yes option of tkprof - http://tonguc.wordpress.com/2006/12/30/introduction-to-oracle-trace-utulity-and-understanding-the-fundamental-performance-equation/
    Since we are talking about a web application you may use a database logon trigger to start sql trace for your application user, or if possible you may set sql_trace database parameter to true at instance level for a while and since you are at 10g you can use new package dbms_monitor and trcsess utility - http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/sqltrace.htm#sthref2001
    Best regards.

  • How to get selected value from SelectOneChoice

    Hi,
    I'm facing a problem to get selected value from SelectOneChoice. I have valueChangeListener event on a (SelectOneChoice)item. After user makes a choice I want to store selected value in a bean property to pass it to a method.
    For example List item shows dname from dept table after user makes a choice I want to get deptno and populate into bean which I use to pass into my method.
    If I use valueChangeEvent.getNewValue() I always get negative value instead I want deptno selected. Sample code pasted below.
    public void setDeptno(ValueChangeEvent valueChangeEvent) {
    BindingContainer b = getBindings();
    OperationBinding oB = b.getOperationBinding("setDeptno");
    //Checking instance of because same method is called from another text inputText item.
    if (valueChangeEvent.getSource() instanceof CoreSelectOneChoice){
    CoreSelectOneChoice cN = (CoreSelectOneChoice)valueChangeEvent.getSource();
    if (columnName.getId().toString().equals("deptDname")){
    JSFUtils.setManagedBeanValue("dept.deptDeptno",valueChangeEvent.getNewValue());
    }

    if your selectOneChoice has value equal to #{bindings.deptno} bound to the iterator Dept1Iterator,
    then the backing code will look more like
                    public void setDeptno(ValueChangeEvent valueChangeEvent) {
                        BindingContainer b = getBindings();
                        OperationBinding oB = b.getOperationBinding("setDeptno");
                        //Checking instance of because same method is called from another text inputText item.
                        if (valueChangeEvent.getSource() instanceof CoreSelectOneChoice){
                            CoreSelectOneChoice cN = (CoreSelectOneChoice)valueChangeEvent.getSource();
                        if (columnName.getId().toString().equals("deptDname")){
                            FacesContext ctx = FacesContext.getCurrentInstance();
                            Application app = ctx.getApplication();
                            ValueBinding bind = app.createValueBinding("#{bindings.Dept1Iterator.currentRow}");
                            Row row = (Row)bind.getValue(ctx);
                            JSFUtils.setManagedBeanValue("dept.deptDeptno", row.getAttribute("deptno"));
                    } I haven't tested it, so it could perfectly not work at all

Maybe you are looking for