Using getElementById() to get values from drop down list

Hi, I am using Netbeans to write this program. I have this .java page that gets the url of the HtmlPage from the .properties page. And when this page is opened in the browser, there are drop down lists that have values I want to get from the user when he/she has selected, and save it to a database. I'm actually using mozilla firefox to open this page, and using firebug to inspect the drop down list element.
I know getElementById is a javascript code, however, my friend told me to use it in the .java page. This is how part of my code looks like. What I'm not sure is how to implement getElementById() and where.
HtmlPage pageMain =EBPage;
WebRequest postRequestSettings = new WebRequest(
new URL(getProperties("trustAdmin")), HttpMethod.POST);
*// Set the request parameters*
postRequestSettings.setRequestParameters(new ArrayList());
postRequestSettings.getRequestParameters().add(new NameValuePair("component", "edit"));
postRequestSettings.getRequestParameters().add(new NameValuePair("formids", "unixTime,instance,time,description,message"));
postRequestSettings.getRequestParameters().add(new NameValuePair("page", "Status"));
postRequestSettings.getRequestParameters().add(new NameValuePair("service", "direct"));
postRequestSettings.getRequestParameters().add(new NameValuePair("session", "T"));
postRequestSettings.getRequestParameters().add(new NameValuePair("submitmode", "submit"));
postRequestSettings.getRequestParameters().add(new NameValuePair("submitname", ""));
*// Insert instance of message here*
postRequestSettings.getRequestParameters().add(new NameValuePair("instance", instance));
*// Insert content of message here*
postRequestSettings.getRequestParameters().add(new NameValuePair("message", message));
*// Insert description of message here*
postRequestSettings.getRequestParameters().add(new NameValuePair("description", description));
*// Insert time of message here*
postRequestSettings.getRequestParameters().add(new NameValuePair("time", time));
*// Convert time to unix seconds*
postRequestSettings.getRequestParameters().add(new NameValuePair("unixTime", String.valueOf(System.currentTimeMillis() / 1000)));
HtmlPage newPage1 = pageMain.getWebClient().getPage(postRequestSettings);
WebRequest requestSettings = new WebRequest(
new URL("http://www.google.com"), HttpMethod.GET);
requestSettings.setRequestParameters(new ArrayList());
requestSettings.getRequestParameters().add(new NameValuePair("page", "Preview"));
requestSettings.getRequestParameters().add(new NameValuePair("service", "page"));
newPage1 = newPage1.getWebClient().getPage(requestSettings);
And I'm told to insert page.getElementById() in the place shown below:
HtmlPage page = null;
page.getElementById()_
*try {*
*// Login proxy*
page = (HtmlPage) jsonBrowser.getPage(getProperties("jsonBrowser"));
String proxyUrl = page.getForms().get(0).getAttribute("action");
System.out.println("Proxy Url" + proxyUrl);
WebRequest requestSettings = new WebRequest(
new URL(proxyUrl), HttpMethod.POST);
requestSettings.setRequestParameters(new ArrayList());
requestSettings.getRequestParameters().add(new NameValuePair("PROXY_SG_PASSWORD", password));
requestSettings.getRequestParameters().add(new NameValuePair("PROXY_SG_PRIVATE_CHALLENGE_STATE", ""));
requestSettings.getRequestParameters().add(new NameValuePair("PROXY_SG_REQUEST_ID", ""));
requestSettings.getRequestParameters().add(new NameValuePair("PROXY_SG_USERNAME", userID));
*// Get the page*
page = page.getWebClient().getPage(requestSettings);
Logger.getLogger(postTrustMessage.class.getName()).log(Level.INFO, "===================================Login in Trust");
Logger.getLogger(postTrustMessage.class.getName()).log(Level.INFO, page.getWebResponse().getContentAsString());
*} catch (IOException ex) {*
Logger.getLogger(postTrustMessage.class.getName()).log(Level.SEVERE, null, ex);
*} catch (FailingHttpStatusCodeException ex) {*
Logger.getLogger(postTrustMessage.class.getName()).log(Level.SEVERE, null, ex);
return page;
Any help would be greatly appreciated. Thanks.

I want to value drop down list from seeded page of EBSString picklistvalue = pageContext.getParameter("PickListBeanID"); //PickListBeanID is the ID of the MessageChoiceBean
Thanks
--Anil
http://oracleanil.blogspot.com/

Similar Messages

  • Web UI - Value not getting selected from drop down list  .

    Hi  All ,
        I am facing a problem in one of the fields which is enhanced with a drop down functionality .
      I have created the GET_V_** method and also the GET_P_**  method for the same .And finally I am able to see the values in the drop down list . But the problem is , when I am trying to select a value from the drop down no values are selected .
    Can anyone plese help me in this as What has to be  done .
    I have taken references from few guides but I am not getting any clear idea of what has to be done .
    Regards,
    Ranjita

    Hi Ranjita,
                     To trigger a round trip, you must have given the event name in GET_P method.
    Same event handler would trigger.
      Please put a break point in Event Handler in IMPL class, and in SET_attr method of the attribute in CN class and see if value is getting set properly or not. Final value that would be displayed on UI would be there in GET_attr method of CN class.
      I hope it helps.
    Thanks,
    Rohit

  • 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

  • Please help: Populating values in drop down list by onchange - javascript !

    I am working on a task - I need to populate drop down named "year" dynamically (from database) depending upon the select of an element from drop down list "carLine" . I am calling javascript funtion on onchange event of the html select and setting property of the selected element.The environment is Struts and dynaactionform is being used . Here is the my html select for both the drop down list s and javascript funtion to set value. The getYears method is defined in the locatoraction action class. But after doing all these carLine is not getting populated with the values corresponding to selected carline.
    Database side is working fine .
    <script type="text/javascript">
    function getYearsForCarline(){
    document.getElementById('method').value = 'getYears';
    document.forms[0].submit();
    alert("submitted");
    </script>
    <html:form styleId="locatorForm" action="/locator/locatorAction" method="post">
              <input type="hidden" name="method" value="getYears" />
              <tr>
                   <td align="center">
                   <table border="0" width="300" cellpadding="0" cellspacing="5">
                        <tr>
                             <td><span class="formLabelEM"><bean:message
                                  key="label.locator.carLine" />*</span>
                             <html:select styleId="carLineBox" property="carLine" onchange="javascript:getYearsForCarline()">
                                  <html:option value="">Select a Carline</html:option>
                                  <html:optionsCollection property="carLines" />
                             </html:select></td>
                        </tr>
                        <tr>
                             <td><span class="formLabelEM"><bean:message
                                  key="label.locator.modelYear" />*</span>
                             <html:select property="year" >
                             <html:option value="">Select Year</html:option>
                                  <html:optionsCollection property="years" />
    Any advise will be highly appreciated . Thanks in advance.

    Thanks both of you for the advise ! My code worked perfectly fine after adding separate action mapping for Year and using that as action in the form though the new action mapping point to the same action class locatorAction ..I still do not understand the reason behind this exactly(any suggestion are most welcome) but it works. Here is code for my action mapping :
    <action path="/locator/locatorYearAction" name="locatorForm"
                   input="/locator/locatorMain.jsp"
                   type="com.apps.sales.web.salesin.actions.LocatorAction"
                   parameter="method" validate="true">
                   <forward name="showCarlines" path="/locator/locatorMain.jsp"
                        redirect="false" />
                   <forward name="showModels" path="/locator/locatorModels.jsp"
                        redirect="false" />     
              </action>

  • Unable to capture data from drop down list in custom added field in migo tcode at item level

    Hi guys,
    need bit help in resolving query related to custom added field in Tcode migo.
    i have added a field in migo at item level ,in this i have used drop down list
    to get data but unable to capture data from drop down list.gown through
    many blogs in scn but unable to resolve.
    Please help me out in this.
    Thanks,
    Umakant.

    Hi,
    U can use following code to fill the list box
    write this code in PBO
    In layout editor please select listbox in dropdown attribute of input field and put some fctcode attribute
    TYPE-POOLS vrm.
      DATA values TYPE vrm_values WITH HEADER LINE.
      TABLES: <ur custom Database table>.
      clear values, values[].
      SELECT * FROM <ur custom Database table>.
        values-text = <TABLE FIELD TO DISPLAY IN DROPDOWN> .
        values-key = <TABLE KEY FIELD TO DISPLAY IN DROPDOWN>.
        APPEND values.
      ENDSELECT.
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          id              = '<SCREEN INPUT FIELD NAME>'
          values          = values[]
        EXCEPTIONS
          id_illegal_name = 1
          OTHERS          = 2.
    Also please define the following before accessing the listbox value
    data: <listbox input field name> type <table field name>,
            <inputfield name where text to display> type string  in top include
    In PAI, select the text from the table into <inputfield name where text to display>  depending on value selected which will be called when enter key is pressed or any vale is selected

  • How to show first parameter value in drop down list as a default value dynamically in ssrs report?

    Hi,
    in my ssrs report i have two parameters, accounts and Manager ,there is a cascading between the accounts parameter and manager parameter, as per the cascading we will get managers names based on the account we selected in the accounts parameter,
    my requirement is the first name in the mangers drop down list  has to get selected as default value.
    please help me with this, it is an urgent requirement.
    Thanks in advance,
    Naveen

    Hi NaveenMSBI,
    According to your description, you want to use cascading parameters in the report, if the accounts are selected when you preview the report, the first manager name will be selected from drop down list as the default value. If so, there can be two scenarios:
    • If manager is single-valued parameter, we can get Available Values and Default Values from the same query as below. Then when the accounts are selected, the first manager name will be selected as default value.
    SELECT managerName FROM table_name WHERE accounts IN (@accounts)
    • If manager is multi-valued parameter, we need to use different query for Available Values and Default Values. In this case, please refer to Patrick’s solution.
    For more information about Adding Cascading Parameters, please refer to the following document:
    http://technet.microsoft.com/en-us/library/aa337498(v=sql.105).aspx
    If you have any questions, please feel free to let me know.
    Best Regards,
    Wendy Fu

  • Populating values to drop down list in Adobe Forms

    Hi,
    We have added a drop down list in our adobe form. Our requirement is Payment Terms should be displayed in this drop down list. We tried by adding values to drop down list in object palette window by using '+' sign. But now we want to display values dynamically from table T052U. We need to bring two fields ZTERM and TEXT1. We don't want to use database connection, just from a table as an importing parameter it should be appended to this list.
    Atpresent, we don't want to use webdynpro or java for getting values.
    Please provide suitable answers.

    hi,
    cretae simple type in data dictionary i don't have any idea to create simple type in adobe forms.
    For creating Simple Type------in Dictionary->Local Dictionary->Data Type->Simple Type(here right click u get  create simple type).and after that choose Enumaration Here u can add values
    and create a node WITH one attribute and this attribute is off Type of that simple type u created in local dictionary and bind that node with interactive form data source property ,now in interactive form drag and drop that attribte from your dataView Run your application  these values will populate in your Interactive form.
    Regards
    Trilochan

  • How to set a default value in a Value Help Drop Down List

    Hi,
    I used an age Range field in my adobe form, the control  is a Value Help Drop Down List. i am populating the drop down using following code.
    IWDAttributeInfo ageInfo = wdContext.nodePersonalData().getNodeInfo().getAttribute("CTAgeRange");
         ISimpleTypeModifiable ageType = ageInfo.getModifiableSimpleType();     
         IModifiableSimpleValueSet ageValueSet =  ageType.getSVServices().getModifiableSimpleValueSet();
         ageValueSet.put("1","21-29");
         ageValueSet.put("2","30-34");
         ageValueSet.put("3","35 or Above");
    My requirement is to set a default value e.g. 30-34 in the age range field.
    I want to give input to iform from my Implementation code only.
    Please help.
    Thanks in advance

    hi Ranjan,
    that means you have to set at design time,
    to set default drop down value you will have to set the value for particular attribute (which is linked to the dropdown element) in the context
    like
    wdContext.currentContext<nodeName>Element.set<FieldName>(<default value>)
    This generally done in Initialization method of the controller.

  • How to add values to drop down list in adobe forms

    how to add values to drop down list in adobe forms

    Hi,
    If you are using WD Java following are steps of filling values in DD Box:
    1 Create a simple type in the Dictionary.
    2 Create an attribute "CountryNew" in the Context of type created by you.
    3 Write following code in the init method of the form:
    IWDAttributeInfo countryinfo =
                   wdContext.nodeEmployee().getNodeInfo().getAttribute("CountryNew");
    ISimpleTypeModifiable Country = countryinfo.getModifiableSimpleType();
    IModifiableSimpleValueSet countryValueSet =
                   Country.getSVServices().getModifiableSimpleValueSet();
    countryValueSet.put("IN", "INDIA");
    countryValueSet.put("US "USA");
    4 Add a Enumrated DD box in the form and bind it to the attribute "CountryNew"
    Hope this helps
    Amit

  • Mobile Me Alias not showing up in "From" drop down list in Mac Mail

    I have a couple of older .mac/Mobile Me email aliases that used to show up as either [email protected] or [email protected] in Mac Mail in the From drop down list, as recently as yesterday. Today, all I can see for any alias that has both the .mac and @me options due to their age, is the @mac.com version. I want to use the @me version of the alias, but this option no longer shows in the list. Newer Mobile Me aliases only have the @me.com address and they show up fine. One last point. If I use the Mobile Me web mail app, I can see both the @mac.com and the @me.com choices in the From drop down list, so it's working as it should.
    Mail isn't working correctly, but since I've not updated the Mail app recently, I suspect Mobile Me isn't sending both versions of the aliases over when the list is refreshed.
    Any suggestions? Thanks!

    It started about a week ago. The "From" drop-dow is now missing in Mac Mail. It should appear beneath the subject line. I was working with MobileMe Chat support for about 3 hours. They cannot solve the problem and have now escalated it to the "Senior Advisor Team."

  • Related Issue column in tracking list gets changed into drop down list in Infopath

    Hi All,
     i have created Tracking list in sharepoint 2010. which has column[Related issue - lookup for field in list[title] by default.
    this field will have a multiple selection check box,2 buttons [Add and remove] and text box[which show the items selected in check box].
    my issue is ,when i try to modify my list in Infopath. this column[Related issue] gets changed into drop down list item.Is is possible  to get the same [old format] back. if so pls guide me..
    I faced the same in Radio button,but i restored it by changing it into option button in Infopath
    V Jean

    Hi ,
    The
    multiple-selection list box control should be by design in InfoPath form, which is corresponding to the SharePoint "Related Issues" field, in my opinion, it cannot be converted to [old format] in InfoPath form, you may need to use SharePoint Designer 2010
    to customize your Issue Tracking list NewForm.aspx/EditForm.aspx per the way in the following article, then "Related Issues" field will still be the old format,
    http://www.cjvandyk.com/blog/Articles/How%20do%20I%20-%20Customize%20the%20NewForm.aspx%20or%20EditForm.aspx%20of%20my%20SharePoint%20list.aspx
    Thanks
    Daniel Yang
    TechNet Community Support

  • External XML data files to add values to drop down lists

    I would like to have external XML data files to add values to drop down lists in my form.. But when i create a data connection it is working properly only in the Preview in Livecycle Designer.. but not in the PDF form(Adobe Reader). Moreover im not sure whether it will work in the form manager..!plzz help me!
    Raghava Kumar V.S.S.

    Hi,
    For the case of raghavakumar, Is it really that I need to have LiveCycle Reader Extensions? Is there any other way that could do the same?
    Thank you

  • Hide id from drop-down list at the top of the detail tab

    Hello Nakisa experts!
    I have one more question about Nakisa OrgChart 4.0 SP 1.
    How can I hide position and org unti id from drop-down list at the top of detail tab, see picture below:
    Thanks in advance.

    I'm not sure you're going to be able to change this.  I think (but I'm afraid I don't know for sure) the section is defined by \WEB-INF\uitemaplates\com\nakisa\manager\omg\ui\subucs\sectionDesigners\DetailHistoryButtonSectionSubUC.xhtml, which after a quick search through the application looks as though it might be populated by a NakisaTrollBin.jar ... which isn't really something you should be looking to edit.
    Nakisa do often write in various settings that can allow features to be tweaked and enabled/disabled.  It could be that there's something you could add into SettingsResources to apply the change you require, but you would need to contact Nakisa about this as they don't document all of these options.
    All this being said I would query why this is being done.  It is not uncommon to say have multiple positions with the same name - e.g. HR Administrator might exist in several org units.  If you are looking through several identically named org units or positions, the unique identifier is going to be the object's ID.  As such it seems most logical to me to keep the ID in the history to allow a user to discern the difference between identically named positions/org units.
    Regards,
    Stephen.

  • Passing database table values to drop down list list using "vrm_set_values"

    DEar Experts,
    How can we pass database travel to drop down list using vrm_set_value call function.
    Looking forward for advise from you experts .
    REgards
    CHandan

    Dear Anubhab,
    Thanks for your suggestion,
    Plz see my code:
    Type-pools: vrm.
    DATA: it_zlt_mita       TYPE STANDARD TABLE OF Zlt_mita,
               wa_zlt_mita    TYPE zlt_mita,
               it_vrm              TYPE vrm_values with header line .
    Selection-Screen: Begin of Block b1 With Frame Title text-001.
      Parameters:
        p_mitar            Type Zlt_mita-M1 as listbox visible length 20 user-command zcc01 obligatory,
        p_mitarn          Type Zlt_mita-M2.
    Selection-Screen : End of Block b1.
    AT SELECTION-SCREEN OUTPUT.
       Select * From ZLT_mita INTO CORRESPONDING FIELDS OF TABLE it_zlt_mita.
      LOOP at it_zlt_mita into wa_zlt_mita.
         it_vrm-key   = wa_zlt_mita-m2.
         it_vrm-text  = wa_zlt_mita-m1.
         APPEND it_vrm.
         Clear: it_vrm, wa_zlt_mita.
      ENDLOOP.
                     CALL FUNCTION 'VRM_SET_VALUES'
                       EXPORTING
                         id                    = 'P_mitar'
                         values                =  it_vrm[]
    *                  EXCEPTIONS
    *                    ID_ILLEGAL_NAME       = 1
    *                    OTHERS                = 2
                     IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
                     ENDIF.
    Data: dynfields type table of dynpread with header line.
         dynfields-fieldname = 'p_mitar'.
          Append dynfields.
    CALL FUNCTION 'DYNP_VALUES_READ'
      EXPORTING
        dyname                               = sy-cprog
        dynumb                               = 1000    " can I use sy-dynnr here
    *   TRANSLATE_TO_UPPER                   = ' '
    *   REQUEST                              = ' '
    *   PERFORM_CONVERSION_EXITS             = ' '
    *   PERFORM_INPUT_CONVERSION             = ' '
    *   DETERMINE_LOOP_INDEX                 = ' '
    *   START_SEARCH_IN_CURRENT_SCREEN       = ' '
    *   START_SEARCH_IN_MAIN_SCREEN          = ' '
    *   START_SEARCH_IN_STACKED_SCREEN       = ' '
    *   START_SEARCH_ON_SCR_STACKPOS         = ' '
    *   SEARCH_OWN_SUBSCREENS_FIRST          = ' '
    *   SEARCHPATH_OF_SUBSCREEN_AREAS        = ' '
      tables
        dynpfields                           =  dynfields
    * EXCEPTIONS
    *   INVALID_ABAPWORKAREA                 = 1
    *   INVALID_DYNPROFIELD                  = 2
    *   INVALID_DYNPRONAME                   = 3
    *   INVALID_DYNPRONUMMER                 = 4
    *   INVALID_REQUEST                      = 5
    *   NO_FIELDDESCRIPTION                  = 6
    *   INVALID_PARAMETER                    = 7
    *   UNDEFIND_ERROR                       = 8
    *   DOUBLE_CONVERSION                    = 9
    *   STEPL_NOT_FOUND                      = 10
    *   OTHERS                               = 11
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'DYNP_VALUES_UPDATE'
      EXPORTING
        dyname                     = sy-cprog
        dynumb                     = 1000
      tables
        dynpfields                 = dynfields
    * EXCEPTIONS
    *   INVALID_ABAPWORKAREA       = 1
    *   INVALID_DYNPROFIELD        = 2
    *   INVALID_DYNPRONAME         = 3
    *   INVALID_DYNPRONUMMER       = 4
    *   INVALID_REQUEST            = 5
    *   NO_FIELDDESCRIPTION        = 6
    *   UNDEFIND_ERROR             = 7
    *   OTHERS                     = 8
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    PLZ SUGGEST ME IF ANYWHERE I WENT WRONG IN MY CONCEPT AS PER YOUR SUGGESTION.
    Looking forward for your further guidance.
    Regards
    Chandan

  • 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

Maybe you are looking for

  • How to get ACK ID inside the BPM

    Hi, In my BPM Scenario,I want to update the database table as soon as the file is created in the destination system.So in the Send step I used Transport Acknowledgement option but I don't know how to get the ACK Id inside the BPM.Please help me. Rega

  • Header row in a table is overlapping when it goes to the second page

    Hello, I have a header row in a table that I need to repeat on new pages if there is enough data to make it go to a new page. It is repeating on the second page, but when it does it all overlaps and is squashed to the left. It is 5 columns long and e

  • Performance issue on iPad

    Hello everyone. Im developing application for an iPad in Flash Builder 4.6 SDK 4.6.0 AIR 3.1 and i have a serious problem with making smooth animations, even with some simple objects that are not sprites. All i get is 5-10 fps while elements are movi

  • Windows vista/photoshop CS4/epson 2200 printer interdiction

    my previous computer used windows xp and worked fine with cs4 and the epson 2200.  unfortunately, I have never been able to get this fairly new 64 bit vista system to work with cs4 and the epson 2200.  I have downloaded the 64 bit driver from epson a

  • Why is my MacMini running slow after stop using it for while

    Hi, Last night after a year or more I decided to turn-on myMacMini to let my daughter use it and to my surprise it's running very slow evenwhen just surfing the internet and I know it wasn't like that in fact this usedto be my primary machine until I