Dropdownlist box & InputField

1. Is there a way to have a onChange/focus lost event for an InputField? I saw the <bsp> find and replace solution, but I need a jsp version. I need to dynamically calculate field values when a value is entered in the inputfield!
2. How do you handle eventing for dropdownlistboxes (HTMLB using DynPages). how do you get the values for the selected items in your event handler method in DynPage?

Hi Siddhartha,
Even I'm unaware of the first issue. But for the second issue, the sol - if you have htmlb dropdownlistbox, use property <b>"onSelect"</b> as given below.
<hbj:dropdownListBox
  id="Tbox"
  width="400"
  selection ="<%=myBean.getSelection() %>"
  model="myBean.model"
  onSelect="onDDSelect">
<b>In DynPage - call the method </b>
public void onDDSelect(Event event) throws PageException
   DropdownListBox sf = (DropdownListBox)  
                         getComponentByName("Tbox");
   sel = sf.getSelection();
Hope this helps.
Thanks,
Praveen
PS: Dont forget to award points if you find it useful or solved.

Similar Messages

  • Peoplecode to get dropdownlist box value and its description

    Hi,
    I have assigned a value and its description to dropdownlist box. when try to get the value and description in somewhere, i didn't get the description. i got only the value of the current row in a rowset. but i want to fetch the description which i assigned to the dropdownlist for the corresponding value. Is there any way to get the description?

    Since it is not a XLAT bound to the field, you cannot use the field class properties.
    What is the source of the dropdownlist?
    If it comes from a database record, you could fetch the description from the database using the &Field.Value as input.
    But this would cause a lot of database roundtrips.
    You could store the value and description in a two dimensional component array variable and load this array with the values and descriptions at PostBuild Event.
    This will only fires ones during the component build.
    Suppose the values are "hardcoded", something like this
    /* Create component 2-dim array */
    Component array of array of string &DropdownArray;
    &DropdownArray = CreateArrayRept("", 0);
    &DropdownArray.Push(CreateArray("value1", "descr1");
    &DropdownArray.Push(CreateArray("value2", "descr2");
    &DropdownArray.Push(CreateArray("value3", "descr3");
    After this populate the dropdownlist with values and descriptions from the array.
    For &i = 1 To &DropdownArray.Len
      &Field.AddDropDownItem(&DropdownArray[&i][1], &DropdownArray[&i][2]);
    End-For;
    Whenever you need to fetch the description of the dropdownlist value, first find the value by &Field.Value and then search within the array for the description.
    /*Get value from dropdown */
    &Value = &Field.Value;
    /*Find index for value*/
    &Ind = &DropdownArray.Find(&Value);
    /*Get description (second index in subarray)*/
    &Descr = &DropdownArray [&Ind][2];
    I am writing the code without an environment, so typos could exist
    Hope this helps.

  • Dropdownlist box problem

    Hi ALL,
    I am developing iview which displays every months employee report.I am using dropdownlist box for months if i select month it should display that months report.Does any one have idea on this?I didnt find any example on that how to trigger selected value using javascript.I reallyh appreciate if anyone post the example code what i need to write in JSP,Bean and class.its really urgent.
    Thanks in advance.

    Hi,
       You can use onClientSelect to trigger the javascript code.
    Here is a sample code to trigger the javascript
    <%String projectId="";%>
    <hbj:dropdownListBox
         id="projectIdDL"
         width="110"
         onClientSelect="getStages()">
    <%projectId=myContext.getParamIdForComponent(projectIdDL);%>
         </hbj:dropdownListBox>
    <script>
    var proid=document.getElementById('<%=projectId%>');
    function getStages()
    //code
    </script>
    Hope this will oslve your problem to trigger a javascript code when you select a value in DropdownListbox
    Regards
    Padmaja

  • DropdownList box to display R/3 table

    Hi,
    I want to display a R/3 table of 5 columns in the dropdownbox with only one column, how can I do that?.
    Is this possible without simple types. Since we dont know the contents of drop-down box at design time, I cant use simple type. How can I achieve this feature?.
    Thanks.
    /sunita.

    Hi,
    If u want to populate values using a DropDownByKey UI Element this code will help you.
    IWDAttributeInfo ainfo = wdContext.node<<NodeName>>().getNodeInfo().getAttribute("<<Value Attribute that is bound to the Drop Down by Key element>>");
    ISimpleTypeModifiable st = aiinfo.getModifiableSimpleType();
    IModifiableSimpleValueSet vs = st.getSVServices().getModifiableSimpleValueSet();
    for(int i=0;i<wdContext.node<<name of the node>>().size();i++)
    vs.put(Key,Value}
    Also go through the following link to know more about Drop Down by key element.
    http://help.sap.com/saphelp_nw04/helpdata/en/08/13dbfb6e779743bb2ca641ebcb3411/frameset.htm
    Check this for a sample application using Drop Down by key UI element.
    http://help.sap.com/saphelp_nw04/helpdata/en/c6/a5d4a523bf4b4c9085a114e46c6ed3/frameset.htm
    Also check out the following discussion in forum :
    https://www.sdn.sap.com/sdn/collaboration.sdn?contenttype=url&content=https%3A//forums.sdn.sap.com/search%21default.jspa%3FforumID%3D52%26threadID%3D52985
    dynamic DropDownByKey
    Regards,
    Saraswathi
    Pls reward point if it is useful information

  • Dropdownlist box value and display field retrieval question

    have a case on a dropdown list where I want to not only retieve the value from the selected item, but I also want to retrieve the display field. I know that you use the the tempDropdownlist.getValue() to get the value, but how do you retrieve the display field?
    The dropdown box is bound to a table with id(int) and Name(string).

    Yes there's no easy way - but you can loop thru the select items list and find the one that matches the current getValue result... and get it that way - see the tutorial on Using Listbox Components...
    http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/index.jsp
    hth,
    v

  • Loading Collections in to DropDownList box using Struts with bean

    Hi folks,
    I am very new to struts.
    I am developing one small web application using struts. I has developed Bussiness Logic, i need to use properly in struts.
    ManufacturerList.java is a Bussiness Logic class using to load all manufacturer from the database. It using by the collection LinkedHashMap.
    I need to use this BL in my struts application.
    GOAL: In sturts application i need to add the car details, one of the property for car is manufacturer.
    When creating the car, it should display all the manufacturer in the new student form.
    Please explain how to create with struts.
    Some of the Code i developed
    {color:#ff0000}<html:form action="/Car?op=saveCar">
    <html:errors/>
    <html:hidden property="op" value="saveCar"/>
    <html:hidden property="carCode"/>
    Car Name <html:text property="model"></html:text> <br>
    Manufacturer
    <!-- Defining the bean for manufacturer list getting from the request-->
    <bean:define id="mfrList" name="ManufacturerList" property="manufacturers"
    scope="request"
    type="java.util.Collection">
    </bean:define>
    <br>
    Manufacturer Year <html:text property="yearOfManufacture"></html:text><br>
    Date of Purchase <html:text property="dateOfPurchase"></html:text> <br>
    <html:submit value="Ok" />
    </html:form>{color}
    This is code is not working properly.... Please explain

    Hi i did like this
    {color:#0000ff}<bean:define id="mfrList" name="ManufacturerList" {color}
    {color:#0000ff}scope="request" {color}
    {color:#0000ff}type="com.icalib.trafficSimulator.ManufacturerList">{color}
    {color:#0000ff}</bean:define>{color}
    {color:#0000ff}<html:select property="make">{color}
    {color:#0000ff}<html:optionsCollection name="mfrList" label="mfrName" value="mfrCode"/>{color}
    {color:#0000ff}</html:select>{color}
    But the error is comming like thisjavax.servlet.ServletException: Cannot create iterator for 1:Honda
    2:Maruti
    3:Hyundai
    4:Toyota
    5:Accord
    6:Test_mfr
    7:test_mfr2
    8:456
    9:again
    10:123
    11:again1
    What to give in the label and value in the optionsCollection                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Is it possible to enter our own value in dropdown list box in Module Pool. How?

    Dear Experts,
    Being new to ABAP, I am trying my hands on Dropdownlist box on Module Pool.
    I want to pull data from Ztable(Custom Table) into Dropdown list box on Screen in Module pool and be able to edit it, delete it and enter new data through it, thus thereby able to manage the Ztable. Is it possible in dropdown.
    Looking forward for experts advice.
    Regards
    Deepika

    Dear Kannan,
    Thanks. But why sud I write an event in Table maintenance generator. My code is in Module Pool and it has no connection with Table Msintenance.
    The I/O field Drop down list box is on the Screen in my Module Pool. I am able to pull data in it from Ztable but now I want to edit this pulled data and also want to enter new data in this dropdown list box.
    Regards
    Deepika

  • Working with 2 list boxes in a tableview

    Hai Friends,
    I have a table view in which the first column is a dropdown listbox and second column is also another dropdown list box.
    Case1: I am working with first row of the tableview
    I am selecting a value say 'Q' in the the first dropdown and its corresponding values say (Q1,Q2,Q3.....) which has to be populated in the second dropdown of the same row.
    Case2: I am working with second row of the tableview.
    I am selecting another value say 'D' in the the first dropdown and its corresponding values say (D1,D2,D3.....) which has to be populated in the second dropdown of the same row.
    I am now coming to the problem that i am facing now.
    Note: i have selected Q in the first row and its corresponding values is Q1,Q2....!
    When i am selecting 'D' in the second row ( D1,D2,D3...) i am getting D1,D2,D3 in the second dropdown <b>in both rows</b>.
    Actually i have to keep Q and corresponding values Q1,Q2... in the first row as i have selected 'Q' in the first row allready. when i am selecting another value value D in second row , first row values should be kept as such with Q and corresponding values Q1,Q2....., and second row should be D with D1,D2,D3.....
    Now i am getting
    Q                              D1,D2,D3
    D                              D1,D2,D3
    Actually it should be
    Q                               Q1,Q2,Q3
    D                               D1,D2,D3
    Problem i am facing is in the iterator class method IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START
    when 'secondfield'.
    Here i am getting values from cookie that i have set in the do_handle_event of the controller.
    Given, code that i have written in iterator class method.
    WHEN 'ETYSHT'.
    **************dropdownlist box**************************************
    IF p_edit_mode IS not INITIAL.
            DATA: etysht TYPE string.
            etysht = m_row_ref->etysht.
            p_replacement_bee = cl_htmlb_textview=>factory( text = etysht ).
            dropdownlistbox = cl_htmlb_dropdownlistbox=>factory( id = p_cell_id ).
            CALL METHOD cl_bsp_server_side_cookie=>get_server_cookie
              EXPORTING
                name                  = 'COURSEGROUP_TO_COURSETYPE'
                application_namespace = application_namespace
                application_name      = application_name
                username              = sy-uname
                session_id            = session_id
                data_name             = 'COURSEGROUP_TO_COURSETYPE'
              CHANGING
                data_value            = itl_cstypenew.
            GET REFERENCE OF itl_cstypenew INTO m_locid_ref.
            dropdownlistbox->table     = m_locid_ref.
            dropdownlistbox->nameofkeycolumn   = 'ETYID'.
            dropdownlistbox->nameofvaluecolumn = 'ETYSHT'.
            dropdownlistbox->selection = m_row_ref->etyid.
            dropdownlistbox->onselect          = 'click'.
            p_replacement_bee = dropdownlistbox.
          ENDIF.
    Looking forward for your valuable suggestion.
    Thanks & Regards,
    Renju.

    Hi Renju,
    I see that you retrieving your drop down values from a cookie but I do not see any code where you are actually selecting the data that you need for second drop down box...
    I mean when Q is selected in the first row...you should be reading only values related to Q in the firs dropdown and then popualte them. Similarly when user is on the second row and selecting D - the you should read values realting to D only (in this case D1, D2, D3). This should help you in keeping the values of the first row and second row as expected. Let me know if this works.
    Cheers

  • F4 help in dropdownlistbox and values in input fields

    I need a F4 help in dropdown list box. Actually i have 2 more input fields alongwith one dropwdown list box. As per my problem
    if i select one value from F4 help then corresponding other values should bepopulated into input fields. For example in F4 help
    of dropdown box i am getting single selection containg three values "15  LIMAPLANT     45802" after selecting it the "15" should
    be only input entry to dropdownlist box, values "LIMA PLANT" and "45802" should be input entry to other two input fields.

    Look at the below code:
    <b>Oncreate:</b>
            entry-name = '15'.   entry-value = '15'.   APPEND entry TO itab.
            entry-name = 'LIMAPLANT'. entry-value = 'LIMAPLANT'. APPEND entry TO itab.
            entry-name = '45802'.  entry-value = '45802'.  APPEND entry TO itab.
    <b>Layout:</b>
         <htmlb:dropdownListBox id                = "myid"
                                  nameOfKeyColumn   = "NAME"
                                  nameOfValueColumn = "VALUE"
                                  onSelect          = "myclick"
                                  selection = "<%= v_selected %>"
                                  table             = "<%= itab %>" />
        <htmlb:inputField id      = "myinp1"
                                value   = "<%= v_field1 %>"  />
        <htmlb:inputField id      = "myinp2"
                                value   = "<%= v_field2 %>"  />
    <b>Page attribute:</b>
    entry     TYPE     IHTTPNVP
    itab     TYPE     TIHTTPNVP
    <b>To capture the event:
    OnInputprocessing:</b>
    DATA: event TYPE REF TO CL_HTMLB_EVENT.
      event = CL_HTMLB_MANAGER=>get_event( runtime->server->request ).
      IF event->id = 'myclick'.
    CALL METHOD request->get_form_field
          EXPORTING
            name  = 'myid'
          RECEIVING
            value = v_selected.
    clear: v_field1, v_field2.
    Loop at itab into entry where name NE v_selected.
    if v_field1 is initial.
    v_field1 = entry-value.
      else.
      v_field2 = entry-value.
      endif.
    endloop.
    endif.
    This will solve your problem..
    <b>* Reward each useful answer</b>
    Raja T

  • HTMLB and JavaScript

    Hi,
    I am using HTMLB in my JSP page.Is there any way to hide or show the HTMLB components when the page is loaded, like HTML onLoad() calling javascript.
    expecting some sample code from HTMLB experts.really i stuck wih this problem for 2 days.
    For example.....i have one DropdownList box.Based on the selected dropdown values ,i need to show and hide one InputField and another Dropdown.
    Regds,
    Jeyanth

    Hi,
    You can achive this in two ways.
    1) client side :
    Have the dynamic fields in style sheet.Sho or hide based on the value selected.
    Please find below code:
    In your drop down list box : mention onclientselect = dispaly()
    <SPAN ID=ss Style="Visibility:hidden;
                       Filter:revealTrans(duration=0)">
    <!-- Your field --!>
    </SPAN>
    <-Javascript>
    function display()
    if ( vlaue ==1 )
      ss.style.visibility = "visible";
    else
      ss1.style.visibility = "visible";
      ss.style.visibility = "hidden";
    // ss1 is style sheet 2 where in which ur second field is placed
    the above code may cause some problem in netscape browsers. But it can be resolve by handling stylesheet properly.
    2) Server side:
    in the dropdown mention onselect = display()
    in your dynpage class mention display() method.
    Have two variables in bean for each field.
    set those fields hide or show based on the value.
    Put your field
    <%
    if ( flag == true )
    your field 1
    else
    your field 2

  • How to read vales from dropdownlistbox placed in tableView Cells

    Hi,
      Thanks for reply.. I got problem of reading values from Dropdownlist box placed in tableView Cells. Please correct me or give some sample to read vales from dropdownlistbox placed in tableView Cells.
    TableView column defined as
            <htmlb:tableViewColumn columnName = "OT_REASON_CODE"
                                   title      = "OT Reason"
                                   type       = "User"
                                   width = "6"
                                   edit       = "true" >
              <htmlb:dropdownListBox id                = "rcode"
                                     table             = "<%= I_YH008 %>"
                                     nameOfKeyColumn   = "OT_REASON_CODE"
                                     nameOfValueColumn = "OT_REASON_DESC" />
            </htmlb:tableViewColumn>
    OnInput processing I am trying to read dorpdown list values selected.
              W_YH022-ENDUZ = TABLE_EVENT->GET_CELL_VALUE(
              ROW_INDEX = SY-TABIX
              COLUMN_INDEX = 3 ).  " Get time
    DATA: data TYPE REF TO CL_HTMLB_DROPDOWNLISTBOX.
    DATA: value type string.
         value = TABLE_EVENT->GET_CELL_ID( row_index    = SY-TABIX
                                      column_index = '7').  " get Cell ID
    data ?= CL_HTMLB_MANAGER=>GET_DATA(
                                     request = runtime->server->request
                                     name    = 'dropdownlistbox'
                                     id      = value
    IF data IS NOT INITIAL.
    W_YH022-OT_REASON_CODE = data->selection. " +Cell Values...I am not getting cell values here+
    endif.

    Hi:
    Do like this
    Layout
          <htmlb:dropdownListBox id="mydropdownlist" >
            <htmlb:listBoxItem key   = "bpno"
                               value = "Business Partner Details" />
            <htmlb:listBoxItem key   = "bpaddress"
                               value = "Business Partner Address" />
          </htmlb:dropdownListBox>
    OnInpurProcessing event - >
    DATA: lcl_dropdown TYPE REF TO cl_htmlb_dropdownlistbox.
    data : selection2 type string.
    lcl_dropdown ?= cl_htmlb_manager=>get_data(
        request = runtime->server->request
        name    = 'dropdownListBox'
        id      = 'mydropdownlist' ).   
    IF NOT lcl_dropdown->selection IS INITIAL.
      selection2 = lcl_dropdown->selection.
    ENDIF.
    Regards
    Shshi

  • Application is not working in Enterprise Portal (Access Denied)

    Hi,
    I have created one application..........This application contains one DropDownByKey element whenever i run this application all the material numbers are automatically populated from R/3....... once i selected material number all the fields related to that material number are displyed in my view..... It is working fine in my NWDS(WebDynpro).....
    I have integrated this application into Enterprise Portal their i am not getting any data into DropDownList box from R/3.... when i run the application i am getting "ACESS DENIED" error ............
    But i have another applicaton(FlightList) which is already integrated into Enterprise Portal..... its working fine......This is also accessing data from R/3.... but its working......
    The material application is not working........
    Please Help Me.....
    Thanks & Regards
    Ravi Shankar B
    <b></b>

    Hi,
      How have you defined the property "WAS host" for the portal system that you have created for the back-end?
    You might get this error if the way you have defined this WAS host property and the way you are calling the portal are different. For example, if your WAS host property is "<hostname>:<portnumber>" and you are calling your portal as "localhost:<portnumber>", then you will get this error.
      Also are you connecting to your portal using the fully qualified domain name? Don't call the portal simply as
    <i>http://<host>:<port>/irj</i> but call it as http://<host>.<domain>:<port>/irj.
    Regards,
    Satyajit.

  • Applcation not working in Enterprise Portal...

    Hi,
    I have created one application..........This application contains one DropDownByKey element whenever i run this application all the material numbers are automatically populated  from R/3....... once i selected material number all the fields related to that material number are displyed in my view..... It is working fine in my NWDS(WebDynpro).....
    I have integrated this application into Enterprise Portal their i am not getting any data into DropDownList box from R/3.... when i run the application i am getting <b>"ACESS DENIED"</b> error ............
    But i have another applicaton(FlightList) which is already integrated into Enterprise Portal..... its working fine......This is also accessing data from R/3.... but its working......
    The material application is not working........
    Please Help Me.....
    Thanks & Regards
    Ravi Shankar B

    Hi
    I have done with static dropdownlist.....means i have created one string simple type in dictonary...i have enterd values in enumaration and i am getting these values in dropdownlist when i am runnig this application in NWDS.... but in EP its not working
    i am not taking any values from R/3 there is no back end connection for this.......
    please help me....
    Thanks & Regards
    Ravi Shankar B
    Message was edited by: RaviShankar B
    Message was edited by: RaviShankar B

  • Does any one know the pdf only scenario?

    Hi
    we came across an 'undocumented feature' of interactive form usage in WDA, that's the so called  pdf only scenario.
    This is how it works:
    1. for the form form UI element , only the pdfsource is bound to a context node , datasource and template source are empty;
    2. the pdfsource is generated from a DDIC  based interactive form ,by calling   FUNCTION 'FP_JOB_OPEN' and FP_JOB_CLOSE;
    3. user input data will be stored and send back to the pdfsource as a document(xstring);
    the advantages are :
    1. DDIC based forms will be available interactively online(which is more friendly to abap developers and more powerful), no need to set to the legacy mode to make it work; (according to SAP LIBRARY, function module based forms are only available for printing);
    2.  the context of WDA application is simple, you can switch between forms without complex binding,there is only one binding between the forms and wda context: the pdfsource;
    3. using ADS method , you can easily to extract xml data out of the pdfsource, and using ST or DOM you can manipulate it easily and send to user again;
    4. ZCI DDIC forms work, no need to use ACF;
    we have tested this on SP16 successfully.
    Imagine you are building a  WDA application,that will deal with different forms with different interfaces,you will realized the power of the pdf only scenario.
    unfortunately, this funcitonality is not officially supported by sap, for ddic forms we have to  follow
    http://help.sap.com/saphelp_nw70/helpdata/en/42/c247dc6227311ce10000000a1553f7/frameset.htm
    , which i think it's confusing.
    i 'd like to know does anyone work with this scenari before, and i hope SAP can hear my voice and to notice the power of this scenario and make it officially a new feature.
    best regards
    jun
    Edited by: Jun Zhang on Oct 7, 2008 11:42 AM

    Hi Jun,
    I'm currently working on, a such scenario . My forms is based on a DDIC interface and should be used with e-mail flow ( off-line ) and into a webdynpro Abap .
    In my form i got dropdownlist box populated by DDIC value , also dynamic text and information such as user name, number of holidays etc...
    I'll do all the code describe in the help, unfortunately when i set my forms as enable in the WD4A , all value pre-populated in the forms ( dropdown list box, user name etc... disapears ...
    If i set the same forms as not enable , all value appears correctly .
    I'll debug the code to see where is the problem, it's in a method where the forms is generated twice and all value disapears. I'll send a message to OSS for this, the answer was first it's because you use dynamic text then the answer was it's because you used DDIC interface please used XML .
    I look at sample web dynpro given by sap but none of them are populated when it's appears (perhaps my ides value are not set ) .
    So i'm currently trying to redevelop my forms based on a XML Interface and will try it . I let you know if it's works ....
    Regards

  • Sample code on how to populate data in DropDownListbox

    Hi all
    i am new to the webdynpro for java.
    i have one UI element called DropDownListBox and i want to populate some desired values to the dropdown list box.
    what are the different ways are there to populate data in DropDownList box.
    for example i have city as dropdownlist box and i want to populate some values in drop downlistbox like bangalore,hyderabad,chennai and delhi,
    can you pls send the sample code on the same?
    Regards
    Suresh Babu

    Hi,
    If you want to retrieve the city names then you can use the standard tables in R/3.
    We have countries list in T500T. Like this we have table for the cities also.
    Or
    You can manually populate a table and bind this table to the list box.
    Please check out this link -
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/ded11778-0801-0010-258f-ac3b9408a194
    http://help.sap.com/saphelp_nw70/helpdata/EN/74/450e8af57065468e88e4b86de47e4b/frameset.htm
    Regards
    Lekha

Maybe you are looking for

  • Out of Memory with 64MB?

    I've made a decent sized application (771k jar) and run it just fine using the jre 1.1.6 on my machine with 128MB of memory. When I run it on any 64MB machine (everything else is the same), it gets realllllly slow and has trouble loading the last 1/3

  • I have just upgraded my account why can i not use it, it keeps redirecting me

    I have just upgraded my account why can i not use it, it keeps redirecting me

  • Defective Page Rendering

    Using Safari 2.04, the http://www.macupdate.com page is mostly blank. No such problem using other browsers. Also, on some web pages, some of the page text is not rendered properly; text is superimposed on other text. What could be the problem? 17" Po

  • Multiple Choices RE: Website Builder Forms

    Website Builder at Verizon has forms you can add. On one element, a drop down box of choices you can edit the nature of the drop down. At that area you can check "accept multiple choices" or something close to that. I have that checked but the only c

  • How do I turn off my disc drive on my macbook pro?

    There is a stuck disc, and I can't get to an Apple store/service provider for a few days.  I think that something is blocking the disk drive, no matter what way I try to force eject, it attempts it, and then it just re-starts running the disc.  It al