How to get value in Second Drop Down based on selection made in first dropd

Hi All,
I have a table with first two columns as dropdown.
The values in first drop down are fixed. However the value in second dropdown should be populated based on selection made in first .
e.g
First Column had different departments say IT, SALES, HR.
Based on department selected I have to populate employee of that department.
For first dropdown I have taken Drop down by index.
What should I select for second drop down and achieve desired functionality? Please guide.
Regards,
Madhvika

Hi
Use drop down by key for fixed values IT, SALES, HR. create on_select action for that drop down.
in on_select method code like this..
  DATA lo_nd_segment1 TYPE REF TO if_wd_context_node.
  DATA lo_el_segment1 TYPE REF TO if_wd_context_element.
  DATA ls_segment1 TYPE wd_this->Element_segment1.
  data lt_segment1 type wd_this->elements_segment1.
  DATA lv_segment TYPE wd_this->Element_segment1-segment.
  data lr_column type ref to cl_wd_table_column.
navigate from <CONTEXT> to <SEGMENT1> via lead selection
  lo_nd_segment1 = wd_context->get_child_node( name = wd_this->wdctx_segment1 ).
get element via lead selection
  lo_el_segment1 = lo_nd_segment1->get_element( ).
  lo_el_segment1 = WDEVENT->GET_CONTEXT_ELEMENT( 'CONTEXT_ELEMENT' ).
get all declared attributes
  lo_el_segment1->get_static_attributes(
    IMPORTING
      static_attributes = ls_segment1 ).
now ls_segment1 contains your first drop down selection value.
  DATA : lv_dropdown type string .
  lv_dropdown =  ls_segment1-segment.
  if lv_dropdown = 'IT'.
// here fill your second drop down based on IT value.
endif.
Hope it solves.
Cheers,
Kris.

Similar Messages

  • How to populate Second drop down based on the first drop down value

    Hi Experts,
    i have a HTML BSP page. with 2 drop down with SELECT and OPTION tags. i need to populate the second drop down based on the first drop down value.
    i tried HTMLB script they work good as stand alone when i try to embed the HTMLB with HTML it does not work.
    Please can you give me a solution only with ABAP script and HTML.
    please clearly let me know on what event i should implement it. sample code is really appreciated .
    With regards,
    Chella

    You can have event handler for first drop down . Then populate the data for 2nd field when the event triggers on first field.

  • How to get "tones" tab  in drop down menu

    how to get "tones" tab  in drop down menu

    I assume that you are referring to the categories on your iTunes library (?), if you are then go into Edit > Preferences and on the General tab make sure that Tones is ticked
    You can also enable the left-hand sidebar on iTunes 11 on a PC via control-S, which then allows you to view the sections of your library (those enabled in Preferences) via that sidebar, and if you have iOS devices they will also show on that sidebar when connected.

  • How to get value of html combo box (i.e select) in jsp?

    Hello,
    I was just wondering how to get value of html combo box in jsp page. My code for combo box is:
    <select name="combo" size="1">
    <%
    List<Project> projects = mgr.getProjects();
    for(Project project : projects){
    %>
    <option value="<%= project.getId()%>"><%= project.getName()%></option>
    <%
    %>
    </select>
    I thought combo.value might give me the value, but it throws exception.
    Any help is appreciated.
    Thanks.

    The combo does not exists in Java, but only in HTML. You have to submit the form containing the combo and then use request.getParameter("combo") to get it's value ;-)

  • Update Drop Down based on selection in Option group

    Good afternoon all-
    I've got an option box ('PanelStatus') with two options: "Panel" (value of 1) and "Non-Panel" (value of 2).
    On the form where this is located, I have a drop down box filled with names.  These people on this table are either Panel or Non-Panel.  So, my idea is that the drop down with names will be refreshed when the radio buttons in PanelStatus are clicked.
    I've got a query that will return the right results, based on what's selected in the Option Group.  However, when I set the Option Group after update event to refresh the dropdown box, Access is telling me "Object doesn't support this property
    or method".
    Any ideas/help are welcome!
    EDIT: I'm thinking it may be because the drop down is unbound...?  Does that explain why this is not working?  If so, any ideas how to do this with the drop down remaining unbound?

    The After Update event of an option group works whether the option group is bound or unbound.
    You should use the Requery method of the combo box.
    Regards, Hans Vogelaar (http://www.eileenslounge.com)

  • How to use value in a drop-down list box as "With these Values" parameter?

    Hello, new user.
    I have a drop-down list box on Page 1, upon which the user can choose a study number. The List Box is named "P1_STUDY_NBR".
    Then I have a list, one entry of which goes to my master-detail form, which is Page 6. I would like it to go to the study number that the user choose on Page 1.
    In my target on the create/edit list entry, I put in "Page in this Application", "Page 6", then in Set these items, I put in
    P6_STUDY_NBR
    My question is what to use in With these values, where I want the contents of the P1_STUDY_NBR. I tried:
    &P1_STUDY_NBR
    and that does not work. If I put in one of the study numbers, like 336-00, then it does work, but I want it to pass the study number the user chooses in the list box. How do I refer to the contents of P1_STUDY_NBR?
    -Mary

    Yes, that does work, thanks. I'm now getting the default value I was putting in yesterday rather than an error message, so there must be something loading it, but I'll hunt around for what process might be doing that, or try re-creating the master-detail form again.

  • Changing value in drop-down based on selected value in another drop-down

    Hi,
    I have two drop-downs - changing value in Combo1, should cause the form to be submitted and values to be populated in Combo 2.
    Approaches i tried - 1) I am using an ActionListener. I am having a valueChange method which accepts an action event. However this appraoch is not working for me. 2) I was wondering if I could use Javacsript to catch the OnChange event , the javascript function would call an appropirate method in my ActionListener. I know in Struts its straightforward, but how do i achive the same here in JSF.
    Any tips would be helpful.
    Thanks
    PS: I already came across some threads in the forum, but could not get an answer. Also, I have a retsriction in terms of using Action LIsteners itself.

    Try using ValueChangeListener instead of ActionListener.
    Here's a working example of a ValueChangeListener. You can customize it and use it for your application.
    The JSP will look like this:
         <h:selectOneMenu value="#{globalsBean.selectedFirst}"
              valueChangeListener="#{globalsBean.changeList}" onchange="submit()">
              <f:selectItems value="#{globalsBean.first}" />
         </h:selectOneMenu>
         <h:selectOneMenu value="#{globalsBean.selectedSecond}">
              <f:selectItems value="#{globalsBean.second}" />
         </h:selectOneMenu>The globalsBean will look like this:
    public class GlobalsBean extends Bean {
         ArrayList first;
         ArrayList second;
         String selectedFirst;
         String selectedSecond;
         public GlobalsBean() {
              first = new ArrayList();
              second = new ArrayList();
              first.add(new SelectItem("1", "1"));
              first.add(new SelectItem("2", "2"));
              selectedFirst = "1";
              selectedSecond = "";
              second.add(new SelectItem("White", "White Cows"));
              second.add(new SelectItem("Brown", "Brown Cows"));
              second.add(new SelectItem("Green", "Green Cows?!?"));
         public ArrayList getFirst() {
              return first;
         public ArrayList getSecond() {
              return second;
         public String getSelectedFirst() {
              return selectedFirst;
         public void setSelectedFirst(String selected) {
               selectedFirst = selected;
         public String getSelectedSecond() {
              return selectedSecond;
         public void setSelectedSecond(String selected) {
               selectedSecond = selected;
         public void changeList(ValueChangeEvent event) throws AbortProcessingException{
              second = new ArrayList();
              String newValue = (String)event.getNewValue();
              setSelectedFirst(newValue);
              if (newValue.equals("1")) {
                   second.add(new SelectItem("White", "White Cows"));
                   second.add(new SelectItem("Brown", "Brown Cows"));
                   second.add(new SelectItem("Green", "Green Cows?!?"));
              } else if (newValue.equals("2")) {
                   second.add(new SelectItem("White/Black", "White Cows with Black spots"));
                   second.add(new SelectItem("Black", "Black Cows"));
              setSelectedSecond("");
    }Let me know how it works out for you.
    CowKing

  • Interactive Report: how to get value of given row/col cell in selected row

    Hi -- I have an interactive report. Instead of the default behavior of the link going to a single row view, I want it to
    go to a form for editing the row. This means I have to be able to populate the form w/ the correct row's information...
    so need to get the value(s) for the PK column(s) in the selected row of the interactive report, so I can select the row
    from the database.
    How can I do this? I see in the report attributes, Link Column section, I can set Rows Uniquely Identified by, and a Unique
    Column (though there could be more than one in a PK). I imagine I'd want to use the rowid, but I'm not sure how the
    rowid of the selected IR row can be referenced. And at that point, I'm not sure how to get the IR column value for
    that row. (Say I'm on the 8th row and I need the first column... How is the column referenced? By a number, it's name,
    its heading?)
    Or maybe I'm not on the right track at all...
    Ideas?
    Thanks,
    Carol

    Hi Carol,
    What I´m trying to do is: defining a button such as when you click it a pl-sql procedure is called, which needs as an input parameter the id of the row selected in my form. what I need first, then, is to get the id of the selected row. how did you get it?
    Thanks in advance
    Francesco

  • How to populate values in to drop down by index from modelnode

    Hi
    I have a dropdownby index and amodel node..model node contains text and value.which i need to be binded to dropdown text or value..and what is purpose of text and value..and is the code required to get texts populated into dropdown.
    Thanks
    Rahul

    Hi,
    The dropdown is usually part of a form, where the selected values are used as form input. For WD it is the input for the backend function. E.g. when the user selects 'Netherlands' from a dropdown list with countries, the backend function should in most cases be filled with the country key, which is often '31' or 'NL' but not 'Netherlands'.
    Now if you are using the dropdown for other purposes than as part of a form (e.g. when you want to change the data or view depending on the current dropdown value), the key is not used.
    Hope this clarifies.
    Good luck,
    Roelof

  • How to populate values in to drop down by index

    Hi in my application  i have dropdownby index with label State.In that dropdown i need to populate all the states of our country like..Tamilnadu,andhraprdesh,Gujrath,Maharastra,Delhi....,and by default it should be populated with Select State ,can u please tell me the code..
    Thanks
    Kishore

    hi,
    1.in ur context create a context value node----eg: MyStates
    2.under that value node create a value attribute--eg: values.
    3.set the cardinality of "MyStates" value node to 0:n
    4.texts property of ur dropdown by index ui element shld be bound to the value attr (values).
    5.in the wdDoInit() method of ur view that has this dropdownbyindex ui element use the follwoing code,
    String    [  ]    states_array    =        new String [  ]   {"tn", "mp", "ap", "karnataka"};
    List list_for_node_elem = new ArrayList();
       for (int i =  0; i <states_array.length; ++i)
          IPrivateMyView.IMyStatesElement elem = wdContext.createMyStatesElement();
          MyStatesElement.setValues(states_array   [i ]   );
          list_for_node_elem.add(MyStatesElement);
       wdContext.nodeMyStates().bind(list_fornode_elem);
       wdContext.nodeMyStates().setLeadSelection(1);
    Regards
    Jayapriya

  • How to remove values from a drop down menu with personalizations

    I have been unable to find any examples of removing values from a dropdown menu using forms personalizations. We have a specific responsibility that we would like to limit the actions that they can carry out on the person form. I have tried setting default values, setting the object to update_allowed = false, and have been unable to come up with a solution. The examples I have found do not show this type of personalization so I am unsure if it can be done. If anyone has done a personalization like this, please post the steps to reproduce or a link to an example. Thanks.

    DineshS wrote:
    Which dropdown menu you want to customized ?The specific menu we would like to customize is the 'Action' menu on the Person form that usually contains 'Create Employment' and so on. We have a specific recruiter responsibility that we would like to limit to 'Create Applicant'. I have been unable to come up with a combination of steps in personalizations that sets that value in the dropdown and allows it then be unchangeable. If you have any suggestions, please let me know. I would prefer not to create a custom form but without personalizations, I might have to.

  • Restricting values on the drop down list, while creating a PO

    Hello SAP Experts,
       Could you help me with the following.
      While creating a PO (ME21N), based on the Account Assignment Category(KNTTP) entered , I have to restrict the values in the drop down list for selecting the material group (MAKTL). I have searched some in SDN, but couldn't find anything suitable. Appreciate any help.
    Thank you,
    Sorab

    Could anyone tell me , if it is possible. Has anyone tried this before.
    Thank you,
    Sorab

  • How to get selected value of a drop down list in CO?

    Hi All,
    Could you plz provide me the code for getting the selected value from the drop down list in CO?
    Thanks
    Debashree

    use pageContext.getParameter("paramName");
    Regards
    Srini

  • How can we get a value in a drop down box without refreshing the page

    In my application i am having 14 drop down boxes. On selcting a particular value in a drop down box i am doing its corresponding functionality. I would like to get these values without refreshing the page each and every time i select a text box, Is it possible to get these values without refreshing the page each and every time.
    Raghu

    There is a new hype going on called AJAX. It is either that, or dumping a lot of information in javascript arrays and reading the information from there when you make selections. I would choose AJAX.

  • Get/Set values from a drop down list

    I am trying to modify the http://www.netbeans.org/kb/60/web/web-jpa-part2.html so that instead of entering the data from a text field (in update & add) the values come from a drop down list from a table. I have drop down lists that are populated bothe from the DB and hard coding. When I run, I am able to see the options on the DDs. But none of the CRUD work. I think this is because my set and get for the drop down is wrong. Then again, I also have a few text fields from the original example which also don't seem to work. Here is a piece of my addButton():
            RowKey[] selectedRowKeys = getTableRowGroup1().getSelectedRowKeys();
            PaymentDetails[] pv = getSessionBean1().getPaymentVoucher();
            int rowId = Integer.parseInt(selectedRowKeys[0].getRowId());
            PaymentDetails upPV = pv[rowId];
            bankCodeDD.getSelected();
            statusDD.getSelected(); // hard coded value
          upPV.setPrepBy((String) prepByField.getText());
          PaymentDetailsController pvController = new PaymentDetailsController();
            pvController.addPaymentDetails(upPV);
            addRequest = false;
            return null;How do I set and get the values from the drop down so than it passed to my bean? When I choose a row to be updated, make changes and click Update, I get this message on my Tomcat:
    com.sun.webui.jsf.component.DropDown::The current value of component form1:deptCodeDD does not match any of the selections.
    Did you forget to reset the value after changing the options?Can someone please point me to a place which shows how I can add a default value from my DD? I tried to follow http://www.netbeans.org/kb/55/dropdowncomp.html, but unable to complete because I get an error for Options api. The auto-fix imported import org.apache.jasper.Options; But the package given in the tutorial is com.sun.webui.jsf.model.Option. My Java version is 1.6.0_07.
    private Options listOptions[];
    ...//getter setter goes here
    listOptions = new Option[noofDBRows + 1];Many Thanks!

    I don't guess what I may add.
    The contents of the table named lookup appear on the screenshot.
    cell A1 contains the string One-Piece, cell B1 contains the 'associated' value 160.
    cell A2 contains the string Two-Piece, cell B2 contains the 'associated' value 130.
    cell A3 contains the string Three-Quarter, cell B3 contains the 'associated' value 150.
    Now table Main
    In column B the cells contain a pop_up menu with four items like the ones described by Jerrold.
    In column C of the cells contain the formula :
    =IFERROR(VLOOKUP(B,Tableau 2 :: A:B,2,FALSE),"")
    I enhanced it since yesterdays because I forgot to treat the case when cell is blank in column B.
    I apologize but as I'm using my machine in French, the screenshot display the French formulas.
    I repeat that you may find useful infos in the PDFs files which we may download from the menus:
    Help > Numbers User Guide
    Help > iWork Formulas and Functions User Guide
    As you are in Stoke-on-Trent maybe your system is set to use the comma as decimal separator.
    If it's that, you must replace the comma by semi-colons in the formulas (you may see them in my screenshot).
    Yvan KOENIG (VALLAURIS, France) mercredi 24 mars 2010 09:27:53

Maybe you are looking for

  • Migo no to posted Accounting document no Function module

    hi, Is there any function modules where i export MBLNR (gr no) and get the corresponding ACCONTUING DOCUMENT details. or tell me how to track the via database with high perfrormance Points assured. regards, Prabhu

  • Can't keep IndexIX tag in bookmarks lists

    For some reason, some of my book files do not seem to have any "knowledge" of the IndexIX paragraph tag, which I need for creating PDF files from a FM book (so it will go in the bookmarks list), and also for when I generate a TOC, because I want to i

  • Order Qty must not be greater than reference Contract Qty

    Is there any way we can stop user to create Order if he enter quantity more than quantity entered in the reference contract. e.g. if i created contract for xyz customer of item abc with quantity 100 each while creating order for the xyz customer of i

  • Create multiple instance in a database

    is it possible to create multiple instance in a database.if possible then is it possible to activate many instance at a time.(in personal edition)

  • Drop parent table

    how to drop a parent table??? if there is hundreds of child table,then it is not possible to disable all the Foreign key one by one...