CheckBox Group Get Selected Items

Hi, I have a problem with a CheckBox Group.
I have different items in the CheckBox Group, and I get the items that are selected.
When I do the checkboxgroup.getselected () returns the selected items, but I do not know how to get the values separately.
I tried to do:
ArrayList array = new ArrayList ();
array. add (checkboxgroup.getSelected ());
but in the array.get (0) add all the values. And I need:
array.get (0) -> first value selected checkboxgroup
array.get (1) -> second value selected checkboxgroup
array.get (2) -> third value selected checkboxgroup
Thank's !
Edited by: henrynxd_08 on Jul 16, 2009 4:55 AM

Never mind..I got it.
it as simple as that:
Alert.show (lst.selectedItem.fieldname);
;)

Similar Messages

  • How to get selected items from a tree in backing bean without adfbc

    Hi ADF Experts,
    Below is my code for af:tree. My question is how can I get selected Items from the selectionListener (without adf bc) this uses formation of tree from backing bean.
    Using Jdev 11.1.1.7.0
    <af:tree var="node" value="#{pageFlowScope.MerchandizeBean.model}"
                      binding="#{pageFlowScope.MerchandizeBean.treeModel}"     id="tree" immediate="true" autoHeightRows="0"
                           styleClass="AFStretchWidth" rowSelection="multiple"
                           selectionListener="#{pageFlowScope.MerchandizeBean.treeNodeSelection}">
                    <f:facet name="nodeStamp">
                      <af:commandLink text="#{node.classDescription}"
                           actionListener="#{pageFlowScope.MerchandizeBean.createListManyItemForMerchandise}"           id="displayTable" partialSubmit="true">
                      </af:commandLink>
                    </f:facet>
                  </af:tree>
        public void treeNodeSelection(SelectionEvent selectionEvent) {
            // Add event code here...
            RichTree tree = (RichTree)selectionEvent.getSource();
                    TreeModel model = (TreeModel)tree.getValue();
                    //get selected value
    Thanks
    Roy

    Hi,
    in a multi select case, try
    RowKeySet rks = tree.getSelectedRowKeys();
    Iterator iter = rks.iterator();
    while(iterator.hasNext()){
    Object aKey = iterator.next();
    tree. setRowKey(aKey);
    Object rowData ? tree.getRowData();
      .... do something with the data here ...
    Frank

  • Getting selected item from combobox itemrenderer and storing in object

    Hi Guys,
    Can anyone help me in this regard. Its very urgent.
    I have a combo box itemrenderer in datagrid column. I want to get the user selected item from the dropdown of the row(s) (User may select values from combo box from multiple rows of datagrid) and corressponding values of all other columns of the rows and store it in an object . Then pass this object to database to update only those rows that user has changed.
    I am able to get the selected item from combo box using "event.currentTarget.selectedItem" and corressponding values of all other columns of the rows using "valueSelect.ID", etc where valueSelect is object which contains data for datagrid. But am stuck up with, how to store the selected item value of the combobox  and corressponding values of all other columns of the rows into an Object ?.
    Can anybody help me with sample to store selected item from combobox and its corressponding values of all other columns into an object which i can send to db...?
    Kindly help me in this regard.
    Thanks,
    Anand.

    Hi!
    Are you using a collection of VO or DTO as the dataprovider of the combobox component?
    If so, have you created some attribute there to control the user's selection in the combobox?
    For instance:
    private var selected:Boolean = false;
    If your solution fits this approach, you may create a new collection that contains just the objects that were selected by the user, it means you can loop through the datagrid's dataprovider and only insert in this new collection those objects that have the attribute "selected" set to true.
    For instance:
    private function getSelectedRecords(datagridDataProvider:ArrayCollection):ArrayCollection
        var newCollection:ArrayCollection = new ArrayCollection();
        for each (var item:Object in datagridDataProvider)
            if (item.selected)
                newCollection.addItem(item)
        return newCollection;
    Afterwards, you may serialize this new collection with your back-end.
    Hope it helps you!
    Cheers,
    @Pablo_Souza

  • Get Selected Items from ListBox

    Hi,
    How do I get the Selected items of a List in Flex.
    I am using a multi-select List.
    Thx

    Never mind..I got it.
    it as simple as that:
    Alert.show (lst.selectedItem.fieldname);
    ;)

  • SRM 7 SOCO enhancement - from step1 to step2, how to get selected items?

    Hi all gurus,
    I'm enhancing the WD /SAPSRM/WDC_DO_SOCO_GAF_1, specifically my requirement is to block FPM navigation if certain conditions based on the selection are met.
    Example:
    An user searches for some PR in sourcing cockpit's step 1, select just a subset from the search result (say, he selects item 1 and item 3, leaving item 2 unselected).
    Then press the NEXT STEP button (which is, as far as I understood, an element managed by the COMPONENTCONTROLLER)..
    Let's suppose the condition we talked about is that each position of a specific PR should be selected; the example above does not meet that condition (only positions 1 and 3 are selected).
    What I'd like to implement is as follows:
    - if the user presses the NEXT_STEP, navigation to the newt WD is cancelled (user remains in STEP 1) and an explicative error message is raised in the message area (e.g. "all positions must be selected").
    Looking for the best, effective way to do this... In particular, I have to:
    -1- identify which positions have been selected when the NEXT_STEP button is pressed;
    -2- implement the check based on positions (that's the easy job);
    -3- raise a message into the messagearea (easy one) and STOP the process so that the user still remains into STEP 1 view (obviously, until his selection meets the specifics).
    I actually overwrote via enhancement the standard PROCESS_EVENT method in the COMPONENTCONTROLLER of that Webdynpro (/SAPSRM/WDC_DO_SOCO_GAF_1), and I'm trying to get the selected lines.
    IF  io_event->mv_event_id = 'FPM_NEXT_STEP'.
        DATA: test           TYPE REF TO /sapsrm/cl_ch_wd_ao_soco.
        DATA: gaf1           TYPE REF TO /sapsrm/if_cll_dom_soco_gaf1.
        DATA: selected_items TYPE WDR_CONTEXT_ELEMENT_SET.
        DATA: selected_item  TYPE /sapsrm/s_cll_wd_soco_workarea.
        test ?= wd_this->ig_componentcontroller~mo_aom_soco.
        CALL METHOD test->/sapsrm/if_cll_ao_soco~get_dom_soco_gaf1
    *  EXPORTING
    *    ion_wd_set                 =
    *    io_wd_view_controller      =
    *    io_wd_component_controller =
          RECEIVING
            ro_dom_soco_gaf1           = gaf1.
        DATA: tabselected  TYPE /SAPSRM/T_CLL_WD_SOCO_SEARCH.
        CALL METHOD gaf1->ZR7_IF_CLL_DOM_SOCO_GAF1~GET_SELECTED_ITEMS
          IMPORTING
            SELECTED_ITEMS = tabselected.
    where ZR7_IF_CLL_DOM_SOCO_GAF1~GET_SELECTED_ITEMS returns the SEARCH_RESULT node of the view GAF1.  This however returns the SEARCH_RESULTS table which contains ALL the positions in the Search table and not just the selected ones... I basically have to modify the get_selected_items, in order to get the selected lines, but actually don't know how and if it's possible; as far as I've seen in debug, there's no way to get the selection ... maybe it has already been cleared at this point?
    Any help provided on these 3 task is highly appreciated and welcome

    Solved! Quite a tricky solution, but it works.

  • How to get selected item value and display text in selectOneChoice ?

    Hi
    Thank you for reading my post
    I bind the a selectOneChoice component to my backing bean so i have an object which represent this component in the backing bean.
    now i need to find which item is selected by use , i know that i can use
    getSelect_service().getValue.toString() , but it will return the value of the selected item, how about its display text ?
    I should say that i create an static list for selectOneChoice items.
    thanks

    Using JDeveloper 10.1.3.1, freshly downloaded off OTN. I used the following code to try and identify the problem you are encountering. I attempted to use a valueChangeListener in combination with af:selectOneChoice components that use SelectItems and the singular SelectItem. I could not reproduce the error in either case. Please post more information about your development environment.
              <af:selectOneChoice label="Label 1"
                                  binding="#{backing_test.selectOneChoice1}"
                                  id="selectOneChoice1"
                                  valueChangeListener="#{backing_test.valueChangeListener}"
                                  autoSubmit="true" immediate="true">
                <af:selectItem label="1" value="1"
                               binding="#{backing_test.selectItem1}"
                               id="selectItem1"/>
                <af:selectItem label="2" value="2"
                               binding="#{backing_test.selectItem2}"
                               id="selectItem2"/>
                <af:selectItem label="3" value="3"
                               binding="#{backing_test.selectItem3}"
                               id="selectItem3"/>
              </af:selectOneChoice>
              <af:selectOneChoice label="Label 2"
                                  binding="#{backing_test.selectOneChoice2}"
                                  id="selectOneChoice2"                              valueChangeListener="#{backing_test.valueChangeListener}"
                                  autoSubmit="true" immediate="true">
                <f:selectItems value="#{backing_test.items}"
                               binding="#{backing_test.selectItems1}"
                               id="selectItems1"/>
              </af:selectOneChoice>
        public void valueChangeListener(ValueChangeEvent evt){
            // returns a UISelectOneChoice object
            System.out.println(evt.getSource().getClass().getName());
            // returns a string
            System.out.println(evt.getNewValue().getClass().getName());
        public Map getItems(){
            items = new HashMap();
            items.put("11","11");
            items.put("12","12");
            items.put("13","13");
            return items;
        }

  • How to get  selected item page number?

    I am developing the plug-in for moving page item from one page to another page,for that i need selected item page number.i.e. i need the page number
    which the item is selected.

    Just access the 'currentCountry' property in the action method.
    public void submit() {
        System.out.println("JSF has already set the property: " + currentCountry);
        // Now do your thing with it. E.g. saving it or so.
        countryDAO.save(currentCountry);
    }

  • WAD checkbox-group: get number of items checked?

    Hi,
    is it possible to find out how many items are checked in a checkboxgroup, maybe with a javascript? It'd like to know if so, because I only want to show certain webitems when a number of items is checked in that checkboxgroup.
    thanks!
    Tom

    You can probably do something like this (not tested)...
    function countselects()
    var inputs=document.all("SAPBW_CHECKBOX_1").getElementsByTagName("INPUT");
    var selectedcounter = 0;
    for (var j=0; j<inputs.length; j++)
         if (inputs[j].type == 'checkbox')
              if (inputs[j].checked) selectedcounter++;
    return (selectedcounter);

  • Lists, groups and selected item

    I'm trying to learn how to work with lists and I'm just not getting it. I've been working on this for days now to no avail.
    My first problem is eachItem is returning only last entry of groupsList instead of the selected specifiedGroup. Then what I would like to do which I'm not too keen on either is, take that selection and match it to one of the choice groups which would contain files or something that the user has preselected previously. Thanks so much! I'm learning a lot of Applescript lately but these lists get the best of me still as I don't fully understand how they work yet. Hoping this will clear my head on things.
    property groupsList : {"List1", "List2", "List3", "List4", "List5"}
    property specifiedGroup : {}
    property choiceOne : {}
    property choiceTwo : {}
    property choiceThree : {}
    property choiceFour : {}
    property choiceFive : {}
    choose from list groupsList
    copy result to specifiedGroup
    log specifiedGroup
    set results to (every item of groupsList)
    repeat with eachItem in results
              if eachItem = specifiedGroup then
                        exit repeat
              end if
    end repeat
    log eachItem

    AppleScript doesn't support variable variables, so you can't refer to variable names like that (at least not in regular AppleScript).  Using a record isn't that much better, because you can't use variables to refer to property keys, either. There are a couple of cheats that use run script, but usually those are more of a pain that they are worth.
    One way that is similar to what you are thinking about would be to create a list of lists, then use your choice to index into that list, for example:
    property groupsList : {"List1", "List2", "List3", "List4", "List5"}
    property choiceOne : {"choiceOne", "this is list 1"}
    property choiceTwo : {"choiceTwo", "this is list 2"}
    property choiceThree : {"choiceThree", "this is list 3"}
    property choiceFour : {"choiceFour", "this is list 4"}
    property choiceFive : {"choiceFive", "this is list 5"}
    set listOfLists to {choiceOne, choiceTwo, choiceThree, choiceFour, choiceFive}
    set theChoice to (choose from list groupsList) as text
    if theChoice is "false" then error number -128 -- cancel
    set specifiedGroup to missing value
    repeat with i from 1 to (count groupsList)
      if item i of groupsList = theChoice then
        set specifiedGroup to item i of listOfLists
        exit repeat
      end if
    end repeat
    log specifiedGroup

  • How to get selected item uid

    Hello
    I want to get the uid of the item selected.is there any way through ISelectionManager? or is there any other way?
    Thanks
    Regards,
    MS Choudry

    Hi MS Choudry,<br /><br />this is not as simple as it seems.<br />You need to build your own "Selection", that means a "SelectLayoutCSB" and a "SelectASB".<br />Below I post the code of our sources, please refer to the documentation about CSB and ASB for more information.<br /><br />SelectLayoutCSB<br />===============<br />class IRSelectLayoutCSB : public CPMUnknown<IIRSelect><br />{<br />public:<br />     IRSelectLayoutCSB(IPMUnknown* boss);<br />     ~IRSelectLayoutCSB(void);<br />     virtual bool16 GetSelectedUID(UID& uid);<br />private:<br />};<br />CREATE_PMINTERFACE (IRSelectLayoutCSB,kIRSelectLayoutCSBImpl)<br />IRSelectLayoutCSB::IRSelectLayoutCSB(IPMUnknown* boss):CPMUnknown<IIRSelect>(boss)<br />{<br />}<br />IRSelectLayoutCSB::~IRSelectLayoutCSB(void)<br />{<br />}<br />bool16 IRSelectLayoutCSB::GetSelectedUID(UID& uid)<br />{<br />     uid = kInvalidUID;<br />     InterfacePtr<ILayoutTarget> iLayoutTarget(this, UseDefaultIID());<br />     if (iLayoutTarget == nil)<br />          return false;<br />     const UIDList selectedItems(iLayoutTarget->GetUIDList(kStripStandoffs));<br />     int32 iNbObjects = selectedItems.Length();<br />     if (iNbObjects != 1)<br />          return false;<br />     UIDRef uidref = selectedItems.GetRef(0);<br />     uid = uidref.GetUID();<br />     return true;<br />}<br /><br />SelectASB:<br />==========<br />class IRSelectASB : public CPMUnknown<IIRSelect><br />{<br />public:<br />     IRSelectASB(IPMUnknown* boss);     <br />     virtual ~IRSelectASB(void);<br />     virtual bool16 GetSelectedUID(UID& uid);<br />};<br />CREATE_PMINTERFACE (IRSelectASB,kIRSelectASBImpl)<br />IRSelectASB::IRSelectASB(IPMUnknown* boss):CPMUnknown<IIRSelect>(boss)<br />{<br />}<br />IRSelectASB::~IRSelectASB(void)<br />{<br />}<br />bool16 IRSelectASB::GetSelectedUID(UID& uid)<br />{<br />     return (Process (make_functor(&IIRSelect::GetSelectedUID, uid), this, IIRSelect::kDefaultIID));<br />}<br /><br />HTH,<br />Daniel

  • How to get select items from multi select in an array or list in jsp

    i have the following multi select which is basically an array coming from the database how can select couple of them and put them in an array in jsp and then save them in the session so when i click the next button they continue till i reach the last finish button of my wizard:
    <SELECT MULTIPLE SIZE=5>
    <OPTION VALUE="o1">Option 1
    <OPTION VALUE="o2">Option 2
    <OPTION VALUE="o3">Option 3
    <OPTION VALUE="o4">Option 4
    <OPTION VALUE="o5">Option 5
    <OPTION VALUE="o6">Option 6
    </SELECT>
    Option 1Option 2Option 3Option 4Option 5Option 6

    Hi,
    As you are tracking changes in ALV data you must define a event handler for ALV evenr ONDATA_CHECK.
    On defining an event handler you will be getting a structure called t_param.
    It contains an element called t_deleted rows.
    See this code to have an idea.
    method ONDATACHECK .
      DATA: x_delete_row LIKE LINE OF r_param->t_deleted_rows.
      "      i_addr_factr TYPE STANDARD TABLE OF ycot_addr_factr,
       "     x_addr_factr LIKE LINE OF i_addr_factr.
    TYPES t_proj_constr TYPE ycot_proj_constr.
      FIELD-SYMBOLS: <fs_row> TYPE t_proj_constr.
      IF wd_comp_controller->ya_optyp = 'DELETE'.
        LOOP AT r_param->t_deleted_rows INTO x_delete_row.
          "x_addr_factr ?= x_delete_row-r_value.
          ASSIGN x_delete_row-r_value->* TO <fs_row>.
        DELETE FROM ycot_proj_constr  WHERE plant = <fs_row>-plant
                                     AND   yr_nbr = <fs_row>-yr_nbr
                                     AND   period = <fs_row>-period
                                     AND  billback_pr_fmly = <fs_row>-billback_pr_fmly
                                     AND  prd_nm = <fs_row>-prd_nm.
      ENDLOOP.
    I hope it helps.
    Regards,
    Sumit Oberoi

  • User Exit - Get Select Item from ME22n

    Hi
    I need get the select in me22n
    is there any u-exit /badi with a parameter like actua_item or select_item?
    thks and regards
    Luis
    Edited by: Luis  Constantino on Sep 7, 2009 2:07 PM

    Hi Margaret,
    There are a few things in this form that may help. Look at the exit event of the dropdown.
    https://acrobat.com/#d=khu3Ik*9LUz60afNWuCUsA
    Hope that helps,
    Niall

  • How to get selected item from AutoSuggestBox in Windows Phone 8.1

    In CS File "SelectedItem" is not working what is the alternative to "SelectedItem" for AutoSuggestBox in WP8.1
    In XAML File:
    <AutoSuggestBox x:Name="tblkpersonname" Width="380" Margin="0,-7,0,0" ItemsSource="{Binding}" TextChanged="tblkpersonname_TextChanged">
    <AutoSuggestBox.ItemTemplate>
    <DataTemplate>
    <TextBlock Text="{Binding Name}"
    Tag="{Binding PersonID}"/>
    </DataTemplate>
    </AutoSuggestBox.ItemTemplate>
    </AutoSuggestBox>
    In Cs File:
    private void tblkpersonname_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args)
    try
    if (tblkpersonname.SelectedItem != null)
    tblkdes.Text = ((values)tblkpersonname.SelectedItem).Description;
    persononlineimg.Source = new BitmapImage(new Uri(((values)tblkpersonname.SelectedItem).FlickrPersonImageUrl, UriKind.RelativeOrAbsolute));
    catch (Exception ex)
    Exceptions.SaveOrSendExceptions("Exception in tblkpersonname_SelectionChanged_1 Method In AddCast.cs file.", ex);
    Devi Prasad.P

    Hi
    Not sure about the code you have mentioned here, there is no property named selecteditem in msdn. Please refer
    https://msdn.microsoft.com/en-us/library/windows.ui.xaml.controls.autosuggestbox.aspx
    <AutoSuggestBox x:Name="suggestions"HorizontalAlignment="Left" Margin="52,62,0,0"
    ItemsSource="{Binding }"VerticalAlignment="Top"
    Width="296" TextChanged="suggestions_TextChanged"
    SuggestionChosen="suggestions_SuggestionChosen"/>private void suggestions_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args)
                if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput)
                    Suggestions.Clear();
                    Suggestions.Add(sender.Text + "Tea");
                    Suggestions.Add(sender.Text + "Tatt");
    private void suggestions_SuggestionChosen(AutoSuggestBox sender, AutoSuggestBoxSuggestionChosenEventArgs args)
                suggestions.Text = "Choosen";
    Something like this can be used
    Regards
    Varun Ravindranath Please 'Mark as Answer' if my post answers your question and 'Vote as Helpful' if it helps you.

  • Data  into a checkbox group

    Hi all,
    My conttext is MonthsOfYear--Node
                         MonthName--attribute
    here i have to populate checkbox group with values as "Jan","Feb"....."Dec"and display the selected months in to a table....
    Wat the problem here is By default Jan is getting selected and getting displayed in table eventhought we select something else than jan it is not getting considered...
    the code i used for  this is
    String[] monthNames = new String []
                 "January", "February", "March", "April",
                 "May", "June", "July", "August",
                 "September", "October", "November", "December",
         List monthsOfYear = new ArrayList();
         for (int i =  0; i < monthNames.length; ++i)
              IPrivateChkView.IMonthsOfYearElement  Myear=wdContext.createMonthsOfYearElement();
              Myear.setMonthName(monthNames<i>);
              monthsOfYear.add(Myear);
         wdContext.nodeMonthsOfYear().bind(monthsOfYear);

    My guess is that the "initializeLeadSelection" property is set to true for context node "MonthsOfYear". Therefore, the first element in the checkbox group is selected by default. Either unset this property at designtime or clear the lead selection in the controller (e.g. in the wdDoInit method or the supply function of the node).
    To keep the table in synch with the selected checkboxes, assign an action to the CheckBoxGroup.onSelect event. In the action handler, update the table data source node according to the selected entries (or invalidate the node and update its elements in a supply function).
    Armin

  • Getting multiple items from a Jlist

    hi i am trying to get selected items from a Jlist to print out
    but can only seem to get one item at a time using getSelectedValue()
    when i try and use getSelectedValues().toString(); i get
    the following print out [Ljava.lang.Object;@ed783f68 can anyone show me
    where i am going wrong and tell me why i get that print out
    cheers
    submitdetails.addActionListener(
                                                   new ActionListener() {
                                                           public void actionPerformed( ActionEvent e )
                                                      String data = privilegesList.getSelectedValue().toString();
                                                      Object data2 = privilegesList.getSelectedValues().toString();
                                                      System.out.println(data);
                                                      System.out.println(data2);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    The getSelectedValues(...) method returns and ARRAY of OBJECTS. You have to loop through the array to get each object separately:
    Object[] values = privilegesList.getSelectedValues();
    for (int j = 0; j < values.length; j++)
    System.out.println ( values[j].toString() );

Maybe you are looking for

  • OSX 2 Finger swipe makes image swipe away

    Hi I am running PS on my MacBook with OSX Lion I am finding that I keep accidentally swiping my image (panning) around as I am attempting to use the OSX swipe gestures. Its very annoying as I have to keep realighning my image up on the desktop. Thank

  • Purchase Requision History Table

    Can anyone tell me the name of the table in which  revision history of Purchase requisition is maintained? Like PO you have ekbe. But for PR which is the revision history table??

  • Frames?

    Hi I want to be able to display a page from another website and display the contents in a HTML region with my APEX application. How would I go about this? I've tried normal HTML for opening a website in a frame and it doesnt display anything. Help pl

  • I have a 2010 mac book pro and track pad is not working well, is there a problem with that year?

    I have a 2010 mac book pro and track pad is not working well, is there a problem with that year. I heard that the 2011's had track pad trouble.

  • Asset report-ar02

    Hiii experts, when the user runs ar02... they  find that some document type example AF documents  are not reflected in the report... i found that the report is based on transaction type and there are 2 types of transaction type in it... 1) asset tran