Programmatically selecting Item in drop down

I want to Programmatically select an item in a dropdown when the page is loaded. I am using the following code:
<h:selectOneMenu binding="#{CatByLocTrend.predefinedQueryDropdown}" id="predefinedQueryDropdown"
style="height: 21px; width: 133px; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 10px" valueChangeListener="#{CatByLocTrend.predefinedQueryDropdown_processValueChange}">
<f:selectItems binding="#{CatByLocTrend.predefinedQueryDropdownSelectItems}"
id="predefinedQueryDropdownSelectItems" value="#{CatByLocTrend.predefinedQueryDropdownDefaultItems}"/>
</h:selectOneMenu>
I use the following to select the item after the default values have been loaded:
predefinedQueryDropdown.setValue(new Integer(2));
predefinedQueryDropdownSelectItems.setValue("Top3Sales");
Neither of these work. How do I programmatically select the value?

I have this working.
Following is some code snippets:
JSP:
<h:selectOneMenu binding="#{Admin$AdminEscalationList.uiSelOneMnuMgrList}" id="dropdown2"
                            style="left: 443px; top: 349px; position: absolute; width: 186px" value="#{Admin$AdminEscalationList.currMgrSelection}">
                            <f:selectItems id="dropdown2SelectItems" value="#{Admin$AdminEscalationList.escalationContntMgrs}"/>
</h:selectOneMenu>Now is the Code behind it:
Java:
    private UISelectOne uiSelOneMnuMgrList  =  new UISelectOne();
    public UISelectOne getUiSelOneMnuMgrList()
        return(uiSelOneMnuMgrList);
    public void setUiSelOneMnuMgrList(UISelectOne oNewVal)
        uiSelOneMnuMgrList      =  oNewVal;
    private int m_nMgrId        =  0;
    public Integer  getCurrMgrSelection()
        return(new Integer(m_nMgrId));
    public void  setCurrMgrSelection(Integer strMgrSelection)
        try
            m_nMgrId            =  strMgrSelection.intValue();
        catch(Exception ex)
// Now is the function that pre-set the selection of the list.
// Call the below function in whereever you want to set the preselection.
uiSelOneMnuMgrList.setValue( getCurrMgrSelection());Of course, I am calling the setCurrMgrSelection() before calling the
uiSelOneMenuMgrList.setValue() function.
Let me know if any of you have any trouble with this.
BB

Similar Messages

  • Using selected items from drop-down list in rest of page

    Hi,
    I hope I'm able to describe clearly what's the problem.
    So I'm implementing a form for the moment. It contains a drop-down list. The user has to select one item from it and as a result another drop-down list on the same page needs to be filled with a couple of options. I wanna do this without refreshing the page, cos else I have to retrieve all the values from boxes that were allready filled in. Is it possible?
    Greetings,
    Raf

    This cn be done with javascript. But you need to cache the data on first load of your jsp.
    regards

  • What is forwarded when " as in-line text" is selected in the drop-down box for forwarding a message. i.e. are attachments forwarded?

    What is forwarded when " as in-line text" is selected in the drop-down box for forwarding a message. i.e. are attachments forwarded with the message or not?

    Some websites require a special client certficate for access. If you don't have that certficate, you'll have to contact the site operator to find out how to get one.
    Sometimes the problem is caused by a web server that is configured to request an optional client certificate. Safari treats the request as mandatory. In that case, other browsers such as Firefox and Chrome may be able to connect to the site, because they ignore the request.
    The first time you were prompted for a certificate, you may have clicked through a dialog that requested access to the Apple certificate in your keychain that is used to secure the iMessage service. In that case, you may be able to regain access to the site in Safari by doing as follows.
    Back up all data.
    Double-click anywhere in the line below on this page to select it:
    com.apple.idms.appleid.prd
    Copy the selected text to the Clipboard by pressing the key combination command-C.
    Launch the Keychain Access application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Keychain Access in the icon grid.
    Paste into the search field in the Keychain Access window by clicking in it and pressing the key combination command-V. An item may appear in the list of keychain items. The Name will begin with string you searched for, and the Kind will be "certificate."
    Delete the item by selecting it and pressing the delete key. It will be recreated automatically the next time you launch the Messages or FaceTime application.
    The next time you visit a site that prompts for an optional client certificate, cancel out of the prompt. You may have to do this several times before the server stops asking.
    Credit for this idea to Christian Braukmueller of SAP.

  • Drop down menus on iPad, the first selection in the drop down will not load as a selection when using safari, what can I do?

    Drop down menus on iPad, the first selection in the drop down will not load as a selection when using safari, what can I do?  I use this for my mobile, on-site auto repair business and not being able to call up repair and diagnostic info and reference for some cars is troublesome for sure. It works fine on the computer and I have installed a remote desktop app as a workaround but it is unreliable because the desktop is not business dedicated and may be off or in use at the time. So is there a known fix for this?
    Let me paint a more descriptive picture, visualize 4 drop down selection menus, first one is for year, next one is for make, 3rd one is model and the last one is for engine size/type. If I wanted to choose a 2012 vehicle it wont work because it is the top selection on the list. This can be forced by selecting any other year and then coming back to 2012. Ok fine, but then let's say I wanted to choose Acura as the make, well it won't take it because again it's the top selection. Again you work around it be selecting any other make and coming back to Acura. Ok now select the model, same trend follows. But now since most Acura vehicles come with dedicated engines and no optional engines I have only 1 selection in that final drop down menu and it will not take my selection and therefore never let me proceed to the info I need.
    This is also true when ordering parts from my wholesaler's website, they use drop downs and I can only get to that last drop down and then I'm stuck. This is blindingly frustrating, what options do I have. I'm not opposed to any avenue at this point.

    Did you ever figure this out? I bought my iPad last week to use in my business as well. I assume you are trying to use alldata? That is where I noticed this same issue. I had problems with identifix working with safari but downloaded a different browser and that works fine. Alldata does not work with either browser. The main difference is that on identifix if there is only one engine selection, it automatically selects the only option and continues to the home page. With alldata you have to make the selection manually even if there is only one option. Honestly if I can't get this to work I am going to return the iPad as it looses a significant amount of usefulness to men

  • How to capture selected value from drop down by index

    Dear friends,
    i want to capture the value of select value from drop down by index, for eg if  select air france, how to capture , could any one please let me know
    Thanks
    Vijaya

    Hi Vijaya,
    You can get the value of selected from drop down as below
    Check out the event handler method attached to Onselect event of the ui element drop down by index , if no event is associated, then create an event and attach to the drop down list
    Now you will be having the CONTEXT_ELEMENT in the WDEVENT parameter
                   data lo_element type ref to if_wd_context_element.
                   lo_element = wdevent->get_context_element( name = 'CONTEXT_ELEMENT').
    Now, you can get the static attribute value of selected  drop down value & let us say your drop down list values are populated from context node 'ND_DRP_DOWN'
                   data ls_data type wd_this->element_nd_drp_down.
                             lo_element->get_static_attributes(
                                       importing
                                       static_attributes = ls_data ).
    Hope this helps you.
    Regards,
    Rama

  • How to capture the value selected in the drop down box

    Hi all,
    I am populating values in  drop down box by using FM vrm_set_values in module pool.
    like below
    01  ABC
    02 ACB
    03 BCA
    04 CAB
    in module pool drop down box element name is RQGM-VALUE.
    Problem is what ever the value is select in the drop down box from above element RQGM-VALUE is not filling any value.
    i need to capture the value selected in the drop down box and pass it to another variable.

    Hi,
    Refer this standard code. Your issue will be resolve.
    REPORT demo_dynpro_dropdown_listbox.
    TYPE-POOLS vrm.
    DATA: name  TYPE vrm_id,
          list  TYPE vrm_values,
          value LIKE LINE OF list.
    DATA: wa_spfli TYPE spfli,
          ok_code TYPE sy-ucomm,
          save_ok TYPE sy-ucomm.
    TABLES demof4help.
    name = 'DEMOF4HELP-CONNID'.
    CALL SCREEN 100.
    MODULE cancel INPUT.
      LEAVE PROGRAM.
    ENDMODULE.
    MODULE init_listbox OUTPUT.
      CLEAR demof4help-connid.
      SELECT  connid cityfrom cityto deptime
        FROM  spfli
        INTO  CORRESPONDING FIELDS OF wa_spfli
       WHERE  carrid = demof4help-carrier2.
        value-key  = wa_spfli-connid.
        WRITE wa_spfli-deptime TO value-text USING EDIT MASK '__:__:__'.
        CONCATENATE value-text
                    wa_spfli-cityfrom
                    wa_spfli-cityto
                    INTO value-text SEPARATED BY space.
        APPEND value TO list.
      ENDSELECT.
      CALL FUNCTION 'VRM_SET_VALUES'
           EXPORTING
                id     = name
                values = list.
    ENDMODULE.
    MODULE user_command_100.
      save_ok = ok_code.
      CLEAR ok_code.
      IF save_ok = 'CARRIER' AND NOT demof4help-carrier2 IS INITIAL.
        LEAVE TO SCREEN 200.
      ELSE.
        SET SCREEN 100.
      ENDIF.
    ENDMODULE.
    MODULE user_command_200.
      save_ok = ok_code.
      CLEAR ok_code.
      IF save_ok = 'SELECTED'.
        MESSAGE i888(sabapdocu) WITH text-001 demof4help-carrier2
                                            demof4help-connid.
      ENDIF.
    ENDMODULE.

  • Create a drop down list that populates based on the selection form another drop down list.

    I need to set up a drop down list that is popualated (i.e. displays a certain list of selctions in the drop down list) based on the choise the form user selects in an adjacent List
    For example
    There are two drop down list field sitting side by side in the form
    1. Select State          2. Select Course
    What I want to do is have a list of states in the first drop down list (1.Select State) and depending on which state the form user selects , the second drop down list (2.Select Course) will populate with a selction of courses available in that selected state only (i.e. it will on;y show course available in QLD if QLD is selcted).
    Is this hard to do?

    Hi,
    I would recommend some posts from Stefan Cameron's blog:
    http://forms.stefcameron.com/2006/09/18/connecting-a-form-to-a-database/
    http://forms.stefcameron.com/2006/09/29/selecting-specific-database-records/
    http://forms.stefcameron.com/2006/12/18/databases-inserting-updating-and-deleting-records/
    http://forms.stefcameron.com/2006/12/07/better-form-design-with-xfa-25/
    Hope that helps,
    Niall

  • Cond display of drop down based on value selected in another drop down form

    Hi,
    I have a requirement in my app in which I need to be able to conditionally display the values in the drop down down list based on the values selected in another drop down list...
    Currently I have 2 drop downs.
    First drop down is a list of Jacks from 2000 to 4999...
    Second Drop down consists Chassis ranging from 1 to 900..
    So when a user selects any jack between 2000 - 2999, in the second drop down only Chassis ranging from 1 to 300 should appear.
    when anything between 3000 - 3999 is selected, Chassis ranging from 301 to 600 should appear..
    and for jacks between 4000 - 4999, Chassis ranging from 601 to 900 should appear in the second drop down.
    Can someone please provide me pointers on how to do this..
    Thanks,
    Nehal

    Hi Larry,
    Thanks for your response..
    Here are the queries for my select lists.
    P62_JACK
    select list query for Jacks:
    select JACK_NUM display_value, JACK_NUM return_value
    from CTS_LIST_OF_JACKS
    order by 1
    P62_CHASSIS_BLADE_PORT
    select NETWORKPORT display_value, NETWORKPORT return_value
    from CTS_LIST_OF_NETWORKPORTS
    order by NETWORKPORT_ID
    jacks range from 2000 to 4000
    chassis_blade_port ranges from 100 to 900...
    Can you please let me know how to do it..
    Thanks,
    Nehal

  • When installing acrobat XI pro the 'select a product' drop down menu does not include my product?

    when installing acrobat XI pro the 'select a product' drop down menu does not include my product?

    For future reference... if you have the trial version installed and plan to buy it after trying it out, there is no need to uninstall it.  It can be activted to full use with the serial number from your purchase.
    You should still be able to download and install the trial version and use your serial number to activate it.  For the direct download link to the trial below, be sure to follow the steps outlined in the Note: Very Important Instructions section on the download pages at this site or else the download will not work properly.
    http://prodesigntools.com/adobe-acrobat-xi-pro-standard-reader-direct-download-links.html

  • Firefox won't let me select options from drop down menus, on the previous version nor on the current 4.0 version that I just downloaded.

    If I am on a site and trying to get information etc, and I have to choose from a drop down menu of any kind, Firefox won't let me choose anything. I can't answer the next question regarding This Happened because I can't select from your drop down.

    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]

  • Why does item in drop down address not delete when selected and right click on delete

    on version 14.1 - to delete an item in dropdown address box, told to put item in address line the right click and select delete - this clears address line but item remains in drop down box and does not go away -why does item not clear when returning to drop down to check on this
    system is XP and ff 14.1

    dud the maintenance add on link you noted - sorry to say problem is the same - when trying to delete an item in the drop down list, i put it in the address line then right click and click delete - it clears from address line but it does not clear from the drop down list ---- please define in detail how to get item cleared from address line to also clear from dropdown list - thank you for your patience - I would simply like to clean up and unclutter the dropdown list without deleting entire history ---thank you

  • Detail region does not refresh when selecting from a drop-down list in master region

    I am using DW CS3 and have updated to version 1.6.1 of Spry.  Using an XML dataset, I am able to create a Spry table as the master region that links to a detail region that displays a small JPG graphic.  It works fine in this format (clicking on a row displays the correct graphic).  However, my table has 80 rows and requires the user to do too much scrolling. So I changed the master region to a drop-down repeat list, but the graphic does not change when a new selection is made in the drop down list.  Listed below is the code produced when I used the insert Spry Repeat List.  I got the same results when adding a spry:setrow="dsChartNurse".  I also tried -- onclick="dsChartNurse.setCurrentRow('{ds_RowID}');" -- which again made no difference.
    When I removed children from the spry:repeat, the master region displayed as a two column list of all 80 items in a drop-down list format.
    <div spry:region="dsChartNurse">
           <select name="select" spry:repeatchildren="dsChartNurse">
             <option value="{name}">{name}</option>
           </select>
    </div>
    <div id="image" spry:detailregion="dsChartNurse">
       <img src="{dataimage}" align="center" style="margin:50px 0 0 0"width="320" height="164" />
    </div>
    Thanks so much to anyone who can help correct my code in order to have a drop-down list display information correctly in the detail region.

    Thanks for the quick reply.  I did solve the problem I was having by changing from onclick to onchange in the master region.  But, now I have another problem with, of course, IE.  I just put in online at http://www.minursemap.org/ageDistNurse.html.  When opened in IE, the drop down list displays the last entry, but the image is for the first in the list.  Thanks again for your help.

  • Appending New item to drop down .. drop down data comes from R3

    Hi,
    We have deployed ESS 1.0 BP. In leave request application we select the leave request type(PL, CL, SL) from drop down menu.
    Here privelige Leave is by default selected... but we need to remove PL from default and add hipen(-) so that user has to compulsory select the leave type from drop Down,
    Now the problem is as this list comes from R3 .. so how can we add new item to this drop down menu. Whether its needed to be done R3 side or do i need to modify Leave request Application. If i need to modify this leave request application than h0w can append hipen to the already list coming in drop down menu...
    Can any person specify in detail from where this configuration is needed to be done..?
    Regards,
    Jigar OZa

    Hi,
    For example the leave types are coming in the below model node from R/3.
    LeavesModelNode - Model Node
             LeaveType - Model Context Attribute
    And the data in this model node is
    - Privlige Leave
    - Casual Leave
    - Sick Leave
    Now create one Value node with the same structure as below in the Component Controller.
    LeavesValueNode - Value Node
             LeaveType - Context Attribute
    Populate your extra value here
    IPublicTestComp.ILeavesValueNodeElement element=wdContext.createLeavesValueNodeElement();
    element.setLeaveType(" - ");
    wdContext.LeavesValueNode ().addElement(element);
    Now Populate the values from model node to value node as below
    for(int i=0;i<wdContext.nodeLeavesModelNode.size();i++)
    IPublicTestComp.ILeavesValueNodeElement element=wdContext.createLeavesValueNodeElement();
    element.setLeaveType(wdContext.nodeLeavesModelNode().nodeLeavesModelNodeElementAt(i).getLeaveType());
    wdContext.LeavesValueNode ().addElement(element);
    Now map this LeavesValueNode to your View Controller and bind to your dropdown list also.
    Regards,
    Charan

  • Open a new form based on the selection from the drop down list

    Good Morning Everyone,
    Can any one please advise how I can start to build the form that has a drop down list(DDL) to list other forms so the user can select one from the selection of that DDL to open a new form.
    e.g  A form in workspace ES3 with drop down list to list 3 forms: form1, form2, form3. When user select form1 from the DDL, then it will kick off the render servic to launch form1 in workspace ES3.
    Thanks in advance,
    HD

    Hi,
    I'm not surea about the data structure...Are there two ClassNodes, one for "VALVES" and one for "BOLTS"??
    and for scripting it is no good idea if the names of the attributes are value, don't know if this is your naming...
    but to access a node of the DATA view -->
    //var selection --> you have assigned "VALVES"
      var onodeCN =  xfa.resolveNodes("xfa.record.Classification.ClassNode[*].value");
    // get the node with the valves -->
                   for (var i = 0; i < onodeCN.length ; i++) {
                        if ( onodeCN.item(i).value == selection ) {
                                         //get the Leaves of Node VALVES
                                         var onodeVALS = xfa.resolveNodes("xfa.record.Classification.ClassNode[+i+].ClassLeaf[*].value");
                                         for (var j = 0; j < onodeVALS.length ; j++) {
                                           // insert values of Leave to 2nd drop down
                                XXX.addItem(onodeVALS.item(j).value, onodeVALS.item(j).value);
    ??works??
    norbert

  • Populate second drop down box based on selection from first drop down box

    Hello, I have a situation involving a drop down box with 9 items to choose from. What I want to do is depending on which of the 9 items the client chooses, this will determine what items are populated in the second drop down boxes (the items in the second drop down box will be mirrored on 9 other drop down boxes).
    For example, my first list box would be titled Review Type and there would be MF, VA, FA, etc. If the MF was selected, then the 10 boxes below (all drop-downs) will be prepopulated with a specifc selection of topics and if they chose VA then another set of topics would be prepopulated.
    Can you please point me out on the proper script to accomplish this? I don't have a xml/data source to connect to so I will be manually inputting the choices.  Thanks!
    Header 1
    Header 2

    I came across a sample of a script that seems to do what I want it to however I can't seem to get it to work all the way through.  It only compiles the items from the 1st case and not the 2nd or 3rd case.  If I click on the 1st case, it will not clear if I click on the 2nd or 3rd case. The items from the 1st case stays static and shows up for other cases.  However if I open the form and click on the 2nd or 3rd case first, it's blank and nothing shows up. Can you please help me out with any fixes to this problem?  Please help!!
    Here's the script:
    switch (this.rawValue){
    case "General Client File Review":
    ft1.clearItems();
    ft1.rawValue
    = null;ft1.addItem("UBIS New Account Application");
    ft1.addItem("Suitability Update Form");
    ft1.addItem("Trust Certification Form");
    ft1.addItem("Corporate Account Form");
    ft1.addItem("Partnership Account Form");
    ft1.addItem("LLC Account Form");
    break; 
    case "529 Plan":
    ft1.clearItems();
    ft1.rawValue
    = null;ft1.addItem("UBIS New Account Application");
    ft1.addItem("Suitability Update Form");
    ft1.addItem("Trust Certification Form");
    ft1.addItem("Corporate Account Form");
    ft1.addItem("Partnership Account Form");
    ft1.addItem("LLC Account Form");
    ft1.addItem("529 College Plan Disclosure");
    ft1.addItem("Vendor Application");
    ft1.addItem("Fund Direct Addition Form");
    ft1.addItem("Investment Replacement Form");
    ft1.addItem("RT Transaction Approval");
    break; 
    case "Direct Held Mutual Fund":
    ft1.clearItems();
    ft1.rawValue
    = null;ft1.addItem("UBIS New Account Application");
    ft1.addItem("Suitability Update Form");
    ft1.addItem("Trust Certification Form");
    ft1.addItem("Corporate Account Form");
    ft1.addItem("Partnership Account Form");
    ft1.addItem("LLC Account Form");
    ft1.addItem("Mutual Fund Disclosure");
    ft1.addItem("FINRA MF Expense Analyzer");
    ft1.addItem("Vendor Application");
    ft1.addItem("Fund Direct Addition Form");
    ft1.addItem("Investment Replacement Form");
    ft1.addItem("RT Transaction Approval");
    break;}

Maybe you are looking for

  • JMX 1.0 client to JMX 1.2 mbean possilbe?

    Hi! I'm using Weblogic 8.1 which supports JMX 1.0 spec. I would like to query mbeans in a Weblogic 10.0 server that support JMX 1.2. Is that possible? and how is it done? Regards, Jesper Vrelits

  • How to lock a folder with password ?

    Please tell me how to lock a folder with password (to keep personal files)

  • Need to reinstall BM 3.8 but need sp4

    My BM 3.8 server went down. Another on the way up, but when I tried to install using the sp5.exe patch, it failed with the warning that it a component needed to be installed with sp4, which i cannot fine on downloads at Novell. An iso would be best.

  • How can i delete app store update?

    In my app store appears a red ballon thats tell me that i have to update an app i never download, its twitter but i have to update it with an unkown account :S and i dont like to see that ballon in the app store logo, how can i delete it if the accou

  • Can i access ISA-Cards with the MH-DDK

    ok the basic problemis the following (i posted that already & thx to todd..) i want to access the 8253 timer on a (ISA) PC-DIO-96 card, which is not possible from NIDAQ. now i want to write my own device driver (i dont actually want, but i guess ther