Populating drop down menu based on selection in other dropdown

Hi
I want to know a solution for populating 2 drop downs. The scene is that once the user has logged in he has to select a REGION. The options in region are EAST, WEST, NORTH, SOUTH, ALL.
On selecting the region a second drop down gets populated with the dealers of that particular region.
DROP DOWN 1 : REGION > NORTH
DROP DOWN 2 : DEALERS > ALL DEALERS IN NORTH.
Someone n Everyone please help me urgently.

ok here's what your servlet would look like:
public class getDealers extends HttpServlet {   
    public void doGet(HttpServletRequest request, HttpServletResponse response)  
    throws javax.servlet.ServletException, java.io.IOException  {
        // get the region selected from the form1
        String region = request.getParameter("region");
        if(region != null) {
            //calls a static method which selects dealers from a database or whatever  you have to do to get the list
            Collection listOfDealers = Dealers.findDealersByRegion(region);
            //puts the list in the session.
            request.getSession().setAttribute("listOfDealers", listOfDealers);
            // server side forward back to the page
            RequestDispatcher rd = this.getServletContext().getRequestDispatcher("/mypage.jsp");
            rd.forward(request, response);
        else {
            //handle error
}Hope this helps
good luck!

Similar Messages

  • How to create Drop down menu in the selection screen

    Hi all,
    How to create Drop down menu in the selection screen.
    Fast answer will be highly rewarded
    Regards
    Bikas

    hi ,
    TYPE-POOLS : vrm.
    TABLES:vbak,vbap.
    DATA : v(80) TYPE c.
    DATA: wa_vbak TYPE vbak,
          it_vbak TYPE vbak OCCURS 0 WITH HEADER LINE,
          wa_vbap TYPE vbap,
          it_vbap TYPE vbap OCCURS 0 WITH HEADER LINE.
      DATA: l_name TYPE vrm_id,
            li_list TYPE vrm_values ,
            v_count  TYPE i,
            l_value LIKE LINE OF li_list.
    PARAMETERS: p_test(20) AS LISTBOX VISIBLE LENGTH 60 MODIF ID DAT.
    INITIALIZATION.
    AT SELECTION-SCREEN OUTPUT.
      PERFORM get_data.
      LOOP AT it_vbak.
        l_value-key =  it_vbak-vbeln .
        l_value-text = it_vbak-vbeln .
        APPEND l_value TO li_list.
      ENDLOOP.
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          id              = 'P_TEST'
          values          = li_list
        EXCEPTIONS
          id_illegal_name = 1
          OTHERS          = 2.
    AT SELECTION-SCREEN ON P_TEST.
      clear : li_list , li_list[].
      SELECT vbeln
             matnr
             meins
             FROM vbap
             INTO CORRESPONDING FIELDS OF TABLE it_vbap
             WHERE vbeln = p_test.
    START-OF-SELECTION.
      SELECT vbeln
             matnr
             meins
             FROM vbap
             INTO CORRESPONDING FIELDS OF TABLE it_vbap
             WHERE vbeln = p_test.
      LOOP AT it_vbap.
        WRITE :/ it_vbap-vbeln, it_vbap-matnr,it_vbap-meins.
      ENDLOOP.
    *&      Form  get_Data
          text
    -->  p1        text
    <--  p2        text
    FORM get_data .
      SELECT  vbeln
              FROM vbak
              INTO  CORRESPONDING FIELDS OF TABLE it_vbak.
    ENDFORM.                    " get_Data
    regards,
    venkat.

  • Populating drop down menu's from database dynamically

    Hi
    I m facing a problem of populating the drop down menu from a MS Access database using JSP. But i m not able to do it. Can you please help me out?
    this works perfectly for textarea
    <textarea cols="20" rows="20">
    <% for(int i =1; i <=rsmd.getColumnCount();++i)
    out.println(rsmd.getColumnName(i)); %>
    </textarea>
    but for drop down box it gives problems
    Heres the code!
    <select name="aa" ID = "aa">
    <option value="<% for(int i =1; i <= rsmd.getColumnCount();++i)
    out.println(rsmd.getColumnName(i)); %>" > </option>
    </select>
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 61 in the jsp file: /gv/event.jsp
    Generated servlet error:
    i cannot be resolved
    wat can be the alternative? Please hlp
    Regards
    Sami

    Hi i m facing a problem in jsp while filling the dropdown box<select name="combosubject"  width="10%" maxlength="20"/>
                                  <option ></option>
                                  <%
                                                System.out.println("1st time");
                                                rs=stmt.executeQuery("select subject.name from subject order by name");
                                                while(rs.next())
                                                  subject = rs.getString(1);
                                             %>     
                                             <option ><%=subject%></option>
                                             <%
                             rs.close();
                             stmt.close();
                       %>the problem is that when i execute this code for the first time it works fine and after that it keeps on throwing exception like "No data found", "Column not found"
    on <form> action i have recalled this function that is when i click the search button this page is executed again and at this moment i got the exception

  • Drop-Down menu not retaining selected value

    I'm using LiveCycle Designer ES 8.1.1 with LiveCycle Forms and I render my forms in HTML.  When Google Chrome or Safari are the user's browser the drop-down menus do not retain their selected value when going from page to page.  For example I have a state drop-down on page 1.  The user selects Ohio and then continues on to page 2.  Then the user goes back to page 1 and the state drop-down now has Alabama selected.  If the user is on IE there is no problem.
    Any help would be much appreciated.
    Thank you
    Dennis

    hi...i would like to thank u for the help...the problem has already been resolved though..
    thanks,
    vitish

  • The Print function no longer seems to work in Firefox 6. When typing "Control P" or selecting Print from the file menu nothing happens. No error message, no drop down menu, nothing to select. Help!?

    I can't print, print preview, nothing. I have several printers associated with this computer, including an HP, and PDF creator - none of these appear in a drop down menu, there is no error message, yet these all function fine if I am not on the internet!

    No errors in error console. No effect using *. I tried using the dns name of my localhost both in the Firefox URL and in the javascript and I get exactly the same. I have spent a huge amount of time looking into this issue.
    One thing I noticed is that if I use the examples on the internet (http://arunranga.com/examples/access-control/preflightInvocation.html or http://saltybeagle.com/cors/) they work in the same browser. These examples however, are accessed through HTTP proxies.
    I am wondering if the issue has to do with using the same hostname just with different ports.

  • Adobe Form... Is there a way to use a drop down menu to highlight or note other fields...

    I am working on a simple Adobe form.  I am currently trying to figure out if there is a way to use the answers of a drop down menu to either mark, note or highlight 14 other fields.  There are 9 possibilities in the drop down menu, include a blank and NONE.
    For example if the drop down menu is set to 1, then field 9, 10 and 14 are marked, noted or highlighted. 
    Is this possible with a script?
    Thank you in advance for any help! 

    Have you looked at the properties that are available to form fields. I would look at setting the fill color or border color for a form field. Either of these can be done with Acrobat JavaScript.

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

  • I have created a drop down menu and duplicated it in other parts of the document.

    When a selection is made in a box, they all change.  How can I fix it so that every drop down is independent?

    The "#" indicates the number of the field with the same name. This is referred to as a "widget" and for most fields it can be a problem. Only buttons, check boxes, and radio buttons can have widgets and work independently within limits. Check boxes and radio buttons with the same name but different option values allow only one selection within the group of like named fields.

  • Previously i was able to select tools in the bridge and then select image processor to make jpegs from my tiffs, the image processor tab is no longer on the tools drop down menu

    previously while in bridge, i was able to select tools in the drop down menu and then select image processor to get to the page where i can make tiffs and jpegs. That option is no longer available in the drop down tool selection. How do I make jpegs from my tiffs now in the bridge.
    thanks
    [Moved from the general Cloud forum to the specific Program forum... Mod]

    In current Firefox releases the search bar on the about:home page and the about:newtab page have an autocomplete=off attribute that prevents Firefox from saving form data and now show search suggestions just like you get on the regular Google search page.

  • Show/hide fields when selecting an option from a drop-down menu.

    Hello Gurus!
    I have a question about creating a Java Script withing Acrobat pro.  This is what i would like to do: I created a drop-down menu with several selection entries.  Upon the customer making one of the selection entries, i would like for the correct fields that i created to become visible and all other fields to hide.  Is this even possible to do?  The reasoning behind this is because we have a form that customers have to generate in order to request access to certain financial accounts; we have over 20 different types of accounts and for each instance the customer has to fill out the same form.  By creating a drop down menu, i can use the same form by just changing the drop-down selection and clicking on the designated fields for that selection.  At this time i have over 20 different forms that poing to 20 different account requests and i would hate to send the form 20 different times to one person.  The reason i can not add all fields desired for all accounts is due to the fact that the form would be filled with hundreds of checkmarks and instructions thus making the process too tideous for the customer.  Hope you guys can help out.
    ~Vader

    The good news is, it can be done (and it has been done).
    There are a few things to be aware of, however.
    The most important is that the form must be planned well, which means that you must think carefully about your logic and even more so about your field naming (hierarchical field names are your friend). One fundamental issue, you have to be aware of, is that this form no longer will be a "standard form". The consequence of this is that you may have to be aware that you might get into trouble when you have to prove that your user filled out that particular standard form (talk to your compliance and forms management people about that).
    You also may have to decide whether the form should be usable in Reader. And, if so, how much you want to spend on the right to do so. You will see below why…
    There are actually two approaches for dynamically showing/hiding parts of a form. If your form can be separated between a fixed first page (where you also have the account type selection), and a variable part (depending on the selection), you could use Templates, which you spawn according to the selection, and delete pages when you change the selection. This approach is very easy to implement, but requires Reader Extensions Server to allow it to work in Reader; Acrobat Pro's extended rights are not sufficient for that.
    The other approach is showing/hiding fields. If you did your homework well, it would be very easy to first hide all subsequent fields, and then show the ones you need in two lines of code. This approach does not require extended rights for Reader at all, as long as your forms will always have the same number of pages, for each of your account types. This approach also works for the cases where the differences between the individual forms are very small. It does also work for showing/hiding bigger chunks of the form. In that case, you might create the "background" separately, and then put it as an icon into a button field which you will show/hide together with the carefully placed on top of it active fill-out fields.
    There is a third possibility, which Adobe Propaganda probably would suggest, and that woudl be subforms in LiveCycle Designer. The consequence is, however, that you won't have PDF forms, but proprietary XFA forms instead. And you may have more developing and maintenance work than with the other approaches.
    Back to your original question: you could use a Keystroke script evaluating event.changeEx of the combo box field. Depending on that, you would run your action to set up the according form part. The other way to do it would be evaluating event.value in the onBlur event. The latter would have the advantage that the selection has been made, and you get a bit more time to set up the form (this may in fact be an issue, particularly with Acrobat 9 and 10, which may take their time to show/hide fields).
    Another possibility instead of a drop down (combo box field) would be a popup, where you would have a button to press, and the list of selections pops up. This second method uses app.popUpMenuEx().
    Hope this can help.
    Max Wyss.

  • Dynamically Populating Drop Down Lists

    Hi,
    I am trying to dynamically populate a drop down list on a form based on a selection in another drop down list. I have read the help file "To dynamically populate a second field after populating the first" which goes through an example, however I cannot get this example to work for me.
    I know that the best way to do it is to create an xml file and connect the form to this file. I am new to programming in xml but have had some experience in other forms. The code that I have (from the help page) looks like this;
    <?xml version="1.0" encoding="UTF-8"?>
    <MyData>
       <country/>
       <countries>
          <item uiname="United States" token="US"/>
          <item uiname="Vietnam" token="SRV"/>
       </countries>
       <state/>
       <US>
          <item>California</item>
          <item>New York</item>
          <item>Texas</item>
       </US>
       <SRV>
          <item>An Giang</item>
          <item>Bac Giang</item>
          <item>Bac Kan</item>
       </SRV>
    </MyData>
    I have then followed the instructions on the page, and am unable to populate either field on my form. Perhaps there is something wrong with my code? Or any other suggestions would be greatly appreciated! 
    Thanks

    Hi Paul,
    I have another question,
    I would now like to populate a third drop down menu based on the selection in the second one, however my code is going wrong somewhere as now when I put in the first 2 drop down lists, nothing appears in the second one. ie, the first drop down list I link to countries, and the second to state, as I did with the previous file, but now, when I preview it, I can choose a country, but nothing comes up in state. When I set the first drop down box to countries, I have to specify that I want it to show the uiname, but I can't do that with the second one when I select state using the XML file below, nothing is shown. Where am I going wrong?
    <MyData>
       <Country/>
       <countries>
          <item uiname="United States" token="US"/>
          <item uiname="Vietnam" token="SRV"/>
       </countries>  
       <state/>
       <US>
          <item uiname="California" token="CA"/>     
          <item uiname="New York" token="NY"/>   
          <item uiname="Texas" token="TEX"/>
       </US>
       <SRV>
          <item uiname="An Giang" token="AG"/>
          <item uiname="Ban Giang" token="BG"/>
          <item uiname="Bac Kan" token="BK"/>
       </SRV>
       <time/>
       <CA>
          <item>6</item>
          <item>7</item>
       </CA>
       <NY>
          <item>5</item>
          <item>4</item>
       </NY>
       <TEX>
          <item>3</item>
          <item>8</item>
       </TEX>
       <AG>
          <item>2</item>
       </AG>
       <BG>
          <item>1</item>
       </BG>
       <BK>
          <item>9</item>
       </BK>
    </MyData>
    Thank you for your help!

  • Is it possible to copy data from a drop down menu instead of having to re-type all the data again?

    I am trying to create a form for safety inspections. I need have a list of employees in a drop down menu format. Is there a way to copy the populated drop down menu to be used several times in the document?

    Hi SwitchInc,
    Yes, you can. Please refer to the Screen Shot, hope this help.

  • How to automate Drop Down menu in OpenScript

    Hello Team,
    Can someone help me in automating a drop down menu? The following is what I'm trying to achieve
    For iteration 1 the first value from the drop down menu should be selected, continue rest of the task as per the initial record
    for iteration 2 the second value from the drop down menu should be selected.. and so on till all the values in the drop down are selected.
    I guess we should use for loop? I tried most of the option as per the user guide but unfortunately I wasn't able to crack it :( can some one tell me what to do from the Tree view of the openscript? Alex (guru) can you please throw some light on this :)
    N.B: I was able to make a field data driven!
    Thanks

    Hello,
    Thanks for your reply, please find the drop down box record script. From the below you can see first I selected Accounting from the drop down & then later i selected Administration..similarly if i want to select all the values from the drop down what do i need to do? Do i add a for loop? if yes where do i add them from the Tree view & how. I somehow can't understand the user guide. Or maybe Im not thinking right! Kindly help. I have figured out how to run data driven test from an input file, however in this case I can't possibly add all the values from the drop down in an input file also that approach isn't healthy!
                   web
                             .selectBox(
                                       5,
                                       "/web:window[@index='0' or @title='SEEK - Australia&apos;s no. 1 jobs, employment, career and recruitment site - Microsoft Internet Explorer']/web:document[@index='0']/web:form[@id='layout' or @name='layout' or @index='0']/web:select[(@id='catindustry' or @name='catindustry' or @index='0') and multiple mod 'False']")
                             .selectOptionByText("Accounting");
                             .selectBox(
                                       16,
                                       "/web:window[@index='0' or @title='SEEK - Australia&apos;s no. 1 jobs, employment, career and recruitment site - Microsoft Internet Explorer']/web:document[@index='0']/web:form[@id='layout' or @name='layout' or @index='0']/web:select[(@id='catindustry' or @name='catindustry' or @index='0') and multiple mod 'False']")
                             .selectOptionByText("Administration");

  • Can I click on "bookmarks" and have the drop down menu display ONLY the file imported from Safari?

    I am trying to achieve a one click drop down menu without side selection for "Safari". Possibly I need to drag bookmarks and folders from the "Safari" folder into the "unsupported " folder, but when I tried this it doubled everything I drug in.

    I did find that I could move bookmarks and folders out of the "imported from Safari" folder onto the "unsorted bookmarks" folder. Removed the Safari folder and made sure the "bookmarks menu" was empty, and then closed show all bookmarks. Hoping that when I opened Bookmarks from the very top line of Apple menu items, the only list that would pop down would be the one that I just constructed in "unsorted bookmarks". But alas, what pops down is no visible bookmarks. You have to slide down to "unsorted" which pops open a window offset to the right with what I really want to see, the list of bookmarks that I assembled in Unsorted.

  • FormCentral PDF export: Drop-Down Menu does not print when no choice is made

    FormCentral PDF export: Drop-Down Menu does not print when no choice is made
    I want to be able to print a blank form for the older clients who cannot use a computer. Form has a few drop-down menus and they only appear on the print out if an option is selected. The form was created on FormCentral. Can anybody help?
    Sorry if i'm a noob, not much experience in creating PDF forms yet.
    Thanks for your help,
    Yon

    Hi Perry
    I am using the trial version of Adobe Acrobat and am using the provided FormCentral software to create the form. I find it very limited, but easier to learn. I am creating a financial needs analyser.
    The section of the drop down menu is a selection from 1-5 (rating of importance for financial goals). I want to print out the questions and the empty boxes for people to fill them in by hand (e.g write 1, 2, 3, 4, or 5). When I leave a blank choice, no box is printed out. I write the questions in formatted text and leave the text/caption for the drop-down as blank, as it is difficult to set the margins correctly so various elements align (I pretty much have to estimate).
    As said before, I may have been missing a massive part of the software, but I haven't used any training - just going by instinct so far.
    Do you know if I can do anything about it?
    Thanks,
    Yon

Maybe you are looking for

  • Manage multiple accounts on one lap top

    How do  manage multiple accounts on one lap top? y wife and me have separate Apple ID's and one lap top at home. We have synced our data on the lap top and now face a situation where in her contacts are on my contact list on the phone and vice versa.

  • Getting file compatibility error on PSD files being opened in same program they were created in.

    After creating and saving a PSD file in Photoshop CC, then re-opening it on the same computer in the same program/version, I'm getting the error: Could not complete your request because the file is not compatible with this version of Photoshop. This

  • Hyperlink to a pdf in KN

    Hi! I'm trying to hyperlink to a multi page pdf document. I.e if we come to talk about special features and want to go deeper into it I want to click on the link and open the datasheet. I have tried to add a slide and drag 'n drop my pdf into that sl

  • Error after Copying Query from Cube to Multiprovider

    Hi , I have One cube which  is running fine . Now I have created one Multiprivider  which has only the Cube . Copied the Query in the Cube to the Multiprovider through RSZC transaction . Now the Query copied to Multiprovider  is giving error while ex

  • Publish multiple sites seperately

    I'm using iWeb for a podCast site and now I want to create a seperate site for photos. The podCast site is published to a folder and loaded to a non-Mac.com host. With the change over in iPhoto to publish to iWeb instead of .Mac...I'm running into a