Getting the value of the selected items of the shuttle

Hi Steve,
How to get the selected items of the shuttle in the backing Bean upon clicking submit button?
Regards,
Gareth

Check the ADF Developer Guide and the SRDemo
application for a sample of using the shuttle
http://download.oracle.com/docs/html/B25947_01/web_com
plex008.htm#CEGHACEDHow to get the values from leading list. I have a pop-up with selectManyShuttle. The leading list values are retreived from from emailTable and there is no default values in the trailing List. When I click ok in the popup, the selectedValues is null.
here is my code:
<af:form>
<af:selectOneChoice label="" valuePassThru="true" valueChangeListener="#{backingpsEmailUserContact.refreshSelectedList}" id="usercontactid" autoSubmit="true">
<af:selectItem label="User" value="user"/>
<af:selectItem label="Contact" value="contact"/>
</af:selectOneChoice>
<af:panelHorizontal valign="bottom" partialTriggers="usercontactid">
<af:selectManyShuttle
trailingHeader="Chosen"
leadingHeader="Email"
trailingDescShown="true"
leadingDescShown="true"
size="10"
value="#{backingpsEmailUserContact.selectedValues}" >
<f:selectItems value="#{backingpsEmailUserContact.allItems}"/>
</af:selectManyShuttle>
<af:commandButton text="Ok" action="#{backingpsEmailUserContact.cmdOk}" id="cmdOkid" partialSubmit="true"/>
</af:panelHorizontal>
</af:form>
backingBean method
public void cmdOk(){
Object selectedList = this.getSelectedValues();
// for (int i = 0; i < selectedList.size();i++){
// System.out.println((String)selectedList.get(i));
}

Similar Messages

  • How can I receive the value of a selected item in the backing bean

    I have a table in a jspx file.
    When I go to the detail page I want to do something with the value of the currentrow.
    I want do a calculaction of the value of ClbId.
    How can I receive the value of the selected ClbId in my backing bean
    <af:table value="#{bindings.Searchteamlist.collectionModel}"
    var="row" rows="#{bindings.Searchteamlist.rangeSize}"
    first="#{bindings.Searchteamlist.rangeStart}"
    emptyText="#{bindings.Searchteamlist.viewable ? 'No rows yet.' : 'Access Denied.'}"
    selectionState="#{bindings.Searchteamlist.collectionModel.selectedRow}"
    selectionListener="#{bindings.Searchteamlist.collectionModel.makeCurrent}"
    rendered="#{backing_FirstFlag_Club_Club.searchFirstTimeClub_Club_AdresAndereClubs == false}">
    <af:column sortProperty="Matricule" sortable="true"
    headerText="#{bindings.Searchteamlist.labels.Matricule}">
    <af:outputText value="#{row.Matricule}"/>
    </af:column>
    <af:column sortProperty="ClbId" sortable="true"
    headerText="#{bindings.Searchteamlist.labels.ClbId}">
    <af:outputText value="#{row.ClbId}">
    <f:convertNumber groupingUsed="false"
    pattern="#{bindings.Searchteamlist.formats.ClbId}"/>
    </af:outputText>
    </af:column>
    <af:column sortProperty="Nom" sortable="true"
    headerText="#{bindings.Searchteamlist.labels.Nom}">
    <af:outputText value="#{row.Nom}"/>
    </af:column>
    <f:facet name="selection">
    <af:tableSelectOne text="Select and">
    <af:commandButton text="Submit"
    action="club_AdresAndereClubsDetail">
    <af:setActionListener from="#{row}"
    to="#{processScope.row}"/>
    </af:commandButton>
    </af:tableSelectOne>
    </f:facet>
    </af:table>

    hi tde
    Using an Expression Language helper class like this one from Steve Muench ...
    http://radio.weblogs.com/0118231/stories/2006/12/18/sourceForMyFavoriteElHelperClass.html
    ... you could write something like this in your backing bean:
    Integer vClbId = (Integer)EL.get("#{row.ClbId}");(Make sure to cast it to the correct type.)
    success
    Jan Vervecken

  • How to get the value of a clicked item in a shuttle control

    I have a shuttle control (P8_SHUTTLE) that lists then names from scott.emp.
    Now I want to create a dynamic action that fires when I click on one of the names on the left side of the shuttle control.
    I want the dynamic action to recognize the name of the employee that was clicked, and then set the value of a text item (P8_LAST_VALUE) to that ename. (Eventually I want to display the department of that employee in the other text item).
    Here are screen shots of my DA:
    http://www.screencast.com/t/42klMC0Hbk
    http://www.screencast.com/t/Y5lZ4RsaLUI
    Currently, when I click an item in the shuttle control, the text item P8_LAST_VALUE remains blank.
    Thanks,
    Christoph

    Hi Christoph,
    you have to change your jQuery selector in the When section of the Dynamic action to #P8_SHUTTLE_LEFT.
    The shuttle item P8_SHUTTLE is build from to select lists P8_SHUTTLE_LEFT and P8_SHUTTLE_RIGHT.
    regards,
    Erik-jan

  • How to fetch the value of tabular form item in javascript

    Hello all
    I want to do some calculations on the value entered by the user in the textfield of a tabular form, how can I fetch the value of tabular form item in the javascript?
    I am using normal tabular form, not using apex_item tabular form.
    I can pass the current textfield value to the function using "this" as a parameter, but how can I fetch the value of other rows of that same column?
    Thanks
    Tauceef

    Hi Alistair
    jQuery is still not working, but I got it done through some other means, this is the code:
    function total(pThis){
    var l_Row = html_CascadeUpTill(pThis,'TR');
    var l_Table = l_Row.parentNode;
    var l_Row_next = l_Row;
    var n_rows = l_Table.rows;
    var lInputs;
    var v1;
    var sum = 0.0;
    var temp;
    var i = 0;
    var j = 0;
    //alert(n_rows.length);
    while(j < (n_rows.length - 1))
    temp = 0;
    if(l_Row_next != null){
    lInputs = html_Return_Form_Items(l_Row_next,'TEXT');
    v1 = lInputs[0].value;
    //alert(v1);
    sum = parseFloat(sum) + parseFloat(v1);
    l_Row_next = l_Row_next.nextSibling;
    temp = 1;
    if(temp == 0){
    l_Row_next = l_Table.getElementsByTagName('TR')[1];
    lInputs = html_Return_Form_Items(l_Row_next,'TEXT');
    v1 = lInputs[0].value;
    sum = parseFloat(sum) + parseFloat(v1);
    l_Row_next = l_Row_next.nextSibling;
    j= j+1;
    $x('P78_TOTAL').value= parseFloat(sum);
    I am calling this function onblur event of the textfield.
    Still I am having one problem, I want to perform this calculation on load of the page also, how can I do that? because while calling onblur of the textfield I can pass that textfield to this function but on onLoad how I will pass the textfield to call this function so that I will be able to get the textfield value in the function?
    there may be some rows already existing, so I want the total of the existing rows to be displayed in my P78_TOTAL textfield that is why I need to do this calculation on onLoad of the page.
    Thanks
    Tauceef
    Edited by: Tauceef on Jul 8, 2010 4:57 AM

  • How to get the label on selectOneMenu selected item??

    Hi,
    I'm not able to get the label of the selected item in a selectOneMenu. The code I use to fill it is:
    <h:form id="formNacion" name="formNacion">
    <h:selectOneMenu value="#{modelRtbBean.nacion}" id="selectNacion" onchange="this.form.submit();">
    <f:selectItems value="#{dataRecoveryBean.naciones}" id="idItemsNacion"/>
    </h:selectOneMenu>
    </h:form>
    The dataRecoveryBean has this method to fill the content of the component (basically it creates an arrayList of selectItems by recovering data from a database):
    public ArrayList<SelectItem> getNaciones() {
    if ((naciones == null ) || (naciones.isEmpty()) ){
    naciones = new ArrayList<SelectItem>();
    HDBGeografico hdbGeo = new HDBGeografico();
    SqlMadd sqlmadd = new SqlMadd();
    try {
    AccessBD sscm = new AccessBD( );
    sscm.table(hdbGeo.getSqlNaci());
    // The AccessBD object has a reference to the resultset:
    ResultSet rs = sscm.getRS();
    while (rs.next()) {
    naciones.add(new SelectItem((String) rs.getString(1), (String) rs.getString(2)));
    sscm.Close();
    } catch (Exception e) {
    System.out.println(e.toString());
    return naciones;
    the modelRtbBean setNacion recovers the value, but I need its label too, because it's a kind of description that I use later.
    In the modelRtbBean setNacion method I'm able to access the UISelectItems object, but I cannot get the selected item itself
    public void setNacion(String nacion) {
    FacesContext fc = FacesContext.getCurrentInstance();
    if (fc != null) {
    UIViewRoot viewRoot= fc.getViewRoot();
    System.out.println(viewRoot.getViewId());
    HtmlSelectOneMenu selNac = (HtmlSelectOneMenu)viewRoot.findComponent("bodySTB:formNacion:selectNacion");
    if (selNac != null) {
    System.out.println("Nacion value-htmlSelectOneMenu :" + selNac.getValue() );
    System.out.println(selNac.getAccesskey() + selNac.getTitle() + selNac.toString());
    UISelectItems uis = (UISelectItems)selNac.findComponent("idItemsNacion");
    if (uis != null) {
    System.out.println("I have the element...");
    this.nacion = nacion;
    How could it be accessed this selected item label ??

    I finally did it as you suggest, but I found another way to access the label (I don't know if it could be useful for anybody but here it is) :
    In the setter method linked to the SelectOneMenu, you can put in this code:
    FacesContext fc = FacesContext.getCurrentInstance();
    if (fc != null) {
    UIViewRoot viewRoot= fc.getViewRoot();
    System.out.println(viewRoot.getViewId());
    HtmlSelectOneMenu sel = (HtmlSelectOneMenu)viewRoot.findComponent("viewName:formName:selectOneName");
    if (sel != null) {
    UISelectItems uis = (UISelectItems)sel.findComponent("idItemsName");
    if (uis != null) {
    ArrayList<SelectItem> listElem = (ArrayList<SelectItem>) uis.getValue();
    You could put in in the value item of each SelectItem it's index position in the list, so in the setter method
    of the bean linked to the selectOneMenu you would get the index of the selected item as the parameter of the method
    int index = 1; // For easyness in this example
    System.out.println("Label: " + listElem.get(index).getLabel() + " Value: "+ listElem.get(index).getValue());
    Thanks !!!

  • How to get the values from html:select? tag..?

    i tried with this, but its not working...
    <html:select styleClass="text" name="querydefs" property="shortcut"
                 onchange="retrieveOptions()" styleId="firstBox" indexed="true">
    <html:options collection="advanced.choices" property="shortcut" labelProperty="label" />
    </html:select>
                        <td align="left" class="rowcolor1">
                        <script language="javascript" type="text/javascript">
                              function retrieveOptions(){
                             var sel = document.querydefs.options;
                             var selectedOption = sel[sel.selectedIndex].value;
                             document.write(selectedOption);
                           </script>

    <td align="left" class="rowcolor1">
                        <script language="javascript" type="text/javascript">
                              function retrieveOptions(){
                             var sel = document.querydefs.options;
                             var selectedOption = sel[sel.selectedIndex].value;
                             document.write(selectedOption);
                           </script>This java script is not working at all..its not printing anything in document.write();
    This is code..
    <td class="rowcolor1" width="20%">
    <html:select styleClass="text" name="querydefs" property="shortcut"
                             onchange="retrieveSecondOptions()" styleId="firstBox"
                             indexed="true">
                             <html:options collection="advanced.choices" property="shortcut"
                                  labelProperty="label"  />
                        </html:select>i tried with this also. but no use..i'm not the getting the seleced option...
    function retrieveOptions(){
    firstBox = document.getElementById('firstBox');
                             if(firstBox.selectedIndex==0){
          return;
        selectedOption = firstBox.options[firstBox.selectedIndex].value;
    }actually , how to get the values from <html:select> ...?
    my idea is to know which value is selected from the combo box(<html:select> ) if that value is equal some string i have enable a hyperlink to open a popup window

  • How to find out the selected item in the lsit

    Hi all,
    How to find out the selected item in the list,can any please post some examples which easy to understand,because iam not a good programmer

    This sample program uses a checkbox as selection,  you could also use a HOTSPOT.
    report zrich_0002 no standard page heading.
    data: imara type table of mara with header line.
    data: check_box(1) type c,  
       report_lines type i.
    start-of-selection.
    * Create the gui status with BACK button in standard place
    * and a READ button in the application toolbar
      set pf-status 'CHECK'. 
    select * into corresponding fields of table imara           from mara up to 100 rows.
    loop at imara.   
    write:/ check_box as checkbox, imara-matnr, imara-matkl.  
    hide imara-matnr. 
    endloop.
      report_lines  = sy-linno - 1.
    top-of-page. 
    write: 'List of materials'.  uline.
    top-of-page during line-selection.  write:  'Material.....'.  uline.
    at user-command. 
    case sy-ucomm.  
    when 'READ'.   
      check_box = space.    
    set pf-status 'CHECK' excluding 'READ'.
          do report_lines times.       
    read line sy-index field value check_box.    
       if check_box = 'X'.        
    write:/  'You have selected material',
    imara-matnr.       
    endif.   
      enddo. 
    endcase.
    Regards,
    Rich Heilman

  • How can get the value of a HtmlInputText (created in the bean)

    Hi All,
    I have created a HtmlInputText object in the Backing Bean (the getter and setter are in another Bean used to manage the data, getEditableInputText and setEditableInputText)
    //getter and setter in Bean
    public HtmlInputText getEditableInputText() {
    return this.editableInputText;}
    public void setEditableInputText(HtmlInputText editableInputText) {
    this.editableInputText = editableInputText;
    I set the value in the Backin Bean
    The HtmlInputText is bound in the xml in this way:
    <h:inputText id="test" binding="#{Bean.editableInputText}"></h:inputText>
    When I load the page I can see the TextField with the value that I set previously (in the backin bean).
    The problem is when I try to change the value of the texField:
    I change the value, then I click on a button (its action is to call a method to get the value of the field).
    In debug mode I see that the value is allways the first set instead of the new value inserted.
    I tried with getValue and similar but it does not work.
    I tried also to put HtmlInputText in a panel (using a similar logic) and then to get it using getChildren() method but also this does not work.
    Any idea?
    Thanks in advance

    Ok (now I understand)
    I have used bean.getEditedInputText() and it is not null.(I got the HtmlInputTextObject)
    But bean.getEditedInputText().getValue has allways the first value set.
    If I don't set previously the value (in the backin bean) the getValue() is allways null.
    So my problem is that I can set but I cannot get the Value when I change it.
    Edited by: LucaMane on Nov 16, 2008 5:13 AM

  • P6 Professional R8.3 - (Cannot move selected items because the result will exceed the limit of WBS tree maximum levels)

    Hi,
    Has anyone encountered this error "Cannot move selected items because the result will exceed the limit of WBS tree maximum levels"?
    Please advise if there's any way around / solution to this. http://s8.postimg.org/bj900spcl/1_error.jpg
    Thanks.

    Thank you so much MichaelRidino!

  • How to change the selection background color of the selected item in the popup menu of the choice box ?

    How to change the selection background color of the selected item in the popup menu of the choice box ?
    By defaut, the selection background color likes "blue", but if I want it to be "yellow" for example, how should I do ?
    Thanks

    The id is applied by (I think) the skin class of the ChoiceBox. You don't need to define it.
    You have to apply the css in an external style sheet. You can apply the external style sheet to any parent of your choice box, or to the scene (the most usual way to do it).
    Example:
    import java.util.ArrayList;
    import java.util.List;
    import javafx.application.Application;
    import javafx.scene.Scene;
    import javafx.scene.control.ChoiceBox;
    import javafx.scene.layout.VBox;
    import javafx.stage.Stage;
    public class ChoiceBoxTest extends Application {
      @Override
      public void start(Stage primaryStage) throws Exception {
        primaryStage.setTitle("Example 2");
        final ChoiceBox<String> choiceBox = new ChoiceBox<>();
        List<String> tempResult = new ArrayList<String>();
        for (int i = 0; i < 10; i++) {
          tempResult.add("Item " + i);
        choiceBox.getItems().setAll(tempResult);
        VBox root = new VBox();
        root.getChildren().add(choiceBox);
        final Scene scene = new Scene(root, 300, 250);
        scene.getStylesheets().add("choiceBox.css");
        primaryStage.setScene(scene);
        primaryStage.show();   
      public static void main(String[] args) {
        launch(args);
    choiceBox.css:
    @CHARSET "UTF-8";
    #choice-box-menu-item:focused  {
    -fx-background-color: yellow ;
    #choice-box-menu-item .label {
    -fx-text-fill: black ;
    Message was edited by: James_D

  • HI, I just bought an iPhone 4S. Although my iPad and other iPhone 3GS connect to our server (SBS2003) I cannot get through.  It checks all items in the connection and then I get the message :Cannot get mail, the connection to the server failed."

    HI, I just bought an iPhone 4S. Although my iPad and other iPhone 3GS connect to our server (SBS2003) I cannot get through.  It checks all items in the connection and then I get the message :Cannot get mail, the connection to the server failed."  I Tried everything, rebooting, reset all iPhone, etc.  All Apple devices work perfectly expect mine.  Please advise

    Look at iOS Troubleshooting Wi-Fi networks and connections  http://support.apple.com/kb/TS1398
    Additional things to try.
    Turn Off your iPad. Then turn Off (disconnect power cord) the wireless router & then back On. Now boot your iPad. Hopefully it will see the WiFi.
    On your iPad go to Settings > General > Reset > Reset network settings and see if that enables you to connect.
    If none of the above suggestions work, look at this link.
    iPad Wi-Fi Problems: Comprehensive List of Fixes
    http://appletoolbox.com/2010/04/ipad-wi-fi-problems-comprehensive-list-of-fixes/
     Cheers, Tom

  • When I try to copy pictures to my iphone 4s I get this error message: Cannot copy item. The device has either stopped responding or has been disconnected. Any help?

    When I try to copy a photo from my computer (windows 7) I get this error message: Cannot copy item. The device has either stopped responding or has been disconnected. Any help for this?

    Are you syncing the photos using Itunes?
    When you plug your phone into your PC, in Itunes under the picture tab you can sync photo and then choose the photos.
    Look here more detailed instructions
    http://support.apple.com/kb/HT4236

  • I am having a difficult time getting the duration of multiple selected clips. The duration display only will display the time for one clip.  Yes, I know I can add them up myself, but why?  :-)

    I am having a difficult time getting the duration of multiple selected clips. The duration display will only display the time for one clip not multiple clips.  Yes, I know I can add them up myself, but why?  :-)
    I am using imovie 10.0.6

    For reasons that you would have to ask Apple for they decided not to allow the precise position of the playhead to be shown in iMovie 10 (unlike in FCP 10.1.x).
    Geoff

  • 6.1 Print Templates - auto select items in the print dialog popup

    In the slide deck I have about 6.1 it says the following:
    •Print Templates
    –Print templates can now be used to auto select items in the
    print dialog popup. By default, the out of the box template
    selects the current specification
    Unfortunately I haven't been able to find how to do this in the EP documentation. Could someone point me in the right direction on how to do this?

    Download Extensibility Pack 2.6. It was just released. Take a look at page 11 in the Print Extensibility Guide. It should have the info you need. If not let me know.
    Here is the link for the downloads:
    https://support.oracle.com/CSP/ui/flash.html#tab=PatchHomePage(page=PatchHomePage&id=h1j503ev())

  • After last Moutain Lion update, suddenly and sporadically I cannot move my files using my mouse.  I only get a "ghost" image.  Moving items to the trash is, of course no problem.  Does anyone have a solution?  I've updated my permissions...no go!

    Cannot move icon files using my mouse or cursor after installing Mountion Lion's last update.  After rebooting several times, this sometimes fixes the problem.  I've tried checking and updating my permissions, but this hasn't worked.  What's happening?  I haven't backed up so I can't go back to Lion.  Has this happened to anyone else?  What can I try?  Thanks!

    Try this:
    Repair the Hard Drive and Permissions - Lion/Mountain Lion
    Boot to the Recovery HD:
    Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    Repair
    When the recovery menu appears select Disk Utility. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported then click on the Repair Permissions button. When the process is completed, then quit DU and return to the main menu. Select Restart from the Apple menu.
    Now download and install OS X Mountain Lion Update v10.8.3 (Combo).

Maybe you are looking for