How to get the value of h:selectOneMenu in the javascript

Hi,
I want to get the value of <h:selectOneMenu> value in the javascript.... i have tried doing this but it returns null. can anyone plz suggest me a soln for this issue.
My codes:
JSF codes are:
<a4j:form>
<h:messages/>
<h:panelGrid columns="2" id="chkpanel">
<h:outputText value="Add a new root domain:" />
<h:selectOneMenu id="dmnlst" value="#{domainDetails.selectedDomain}"
onchange="fielddisable()">
<f:selectItems value="#{domainTree.allDomains}" />
</h:selectOneMenu>
<h:outputText value="Name:" />
<h:inputText value="#{domainDetails.domain.name}"
required="true" />
</h:panelGrid>
</a4j:form>
Javascript codes
function fielddisable()
var c=document.getElementById("dmnlst");
alert(c); //am getting null values here....
Thanks in Advance
Pandiyan S

Try a Javascript forum. Java != Javascript.

Similar Messages

  • How to get maximal value from the data/class for show in Map legend

    I make WAD report that using Map Web Item.
    I devide to four (4) classes for legend (Generate_Breaks).
    I want to change default value for the class by javascript and for this,
    I need to get maximal value from the class.
    How to get maximal value from the data/class.
    please give me solution for my problem.
    Many Thx
    Eddy Utomo

    use this to get the following End_date
    <?following-sibling::../END_DATE?>
    Try this
    <?for-each:/ROOT/ROW?>
    ==================
    Current StartDate <?START_DATE?>
    Current End Date <?END_DATE?>
    Next Start Date <?following-sibling::ROW/END_DATE?>
    Previous End Date <?preceding-sibling::ROW[1]/END_DATE?>
    ================
    <?end for-each?>
    o/p
    ==================
    Current StartDate 01-01-1980
    Current End Date 01-01-1988
    Next Start Date 01-01-1990
    Previous End Date
    ================
    ==================
    Current StartDate 01-01-1988
    Current End Date 01-01-1990
    Next Start Date 01-01-2005
    Previous End Date 01-01-1988
    ================
    ==================
    Current StartDate 01-01-2000
    Current End Date 01-01-2005
    Next Start Date
    Previous End Date 01

  • How to get the values of Select-options from the screen.

    The value of parameter can be obtained by function module 'DYNP_VALUES_READ' but How to get the values of Select-options from the screen? I want the F4 help values of select-options B depending on the values in Select-option A.So I want to read the Select-option A's value.

    Hi,
    Refer this following code..this will solve your problem...
    "Following code reads value entered in s_po select options and willprovide search
    "help for s_item depending upon s_po value.
    REPORT TEST.
    TABLES : ekpo.
    DATA: BEGIN OF itab OCCURS 0,
    ebelp LIKE ekpo-ebelp,
    END OF itab.
    SELECT-OPTIONS   s_po FOR ekpo-ebeln.
    SELECT-OPTIONS s_item FOR ekpo-ebelp.
    INITIALIZATION.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_item-low.
      DATA:
      dyn_field TYPE dynpread,
      temp_fields TYPE TABLE OF dynpread,
      zlv_dynpro TYPE syst-repid.
      zlv_dynpro = syst-repid.
      CALL FUNCTION 'DYNP_VALUES_READ'
        EXPORTING
          dyname     = zlv_dynpro
          dynumb     = syst-dynnr
          request    = 'A'
        TABLES
          dynpfields = temp_fields
        EXCEPTIONS
          OTHERS     = 0.
      LOOP AT temp_fields INTO dyn_field.
        IF dyn_field-fieldname EQ 'S_PO-LOW'.
            SELECT * INTO CORRESPONDING fields OF TABLE itab FROM ekpo
            WHERE ebeln EQ dyn_field-fieldvalue.
            EXIT.
        ENDIF.
      ENDLOOP.

  • How to get the value of a variable defined in javascript in JSP

    how to get the value of a variable defined in javascript in/through JSP????

    In Javascript you can use the DOM to access the input element and set it's value before submitting the form. Then it's value will just be passed.

  • How to get default values while using the transaction "BP"

    Hi Group,
    I have a query on how to get default values while using the transaction <b>BP</b>?
    The thing is:
    when I enter into the transaction "BP", I need to see some default values to some of the input fields in the screen.
    how can I achieve this?
    So please kindly let me know the procedure to achieve this.
    Thanks & Regards,
    Vishnu.

    Hi,
    The events of BDT can be used to default some fields on creating a partner.
    For this create a function module for ISDAT. attach that event in BUS7.
    In the ISDAT funtion modulethe following code should be used.
    For example to set the nationality:
    I_BUSDEFAULT-NATIO = 'DE.
    CALL FUNCTION 'BUP_BUPA_FIELDVALUES_SET'
    EXPORTING
    i_busdefault = I_BUSDEFAULT
    Regards, Smita.

  • How to get updated values from the loops while they are running

    Hello,
            I am having difficulty solving a very basic problem, how to access the updated values from the 'FOR loop' while its running?  Basically, the VI  I am currently working on calls two sub VIs. Each sub VI has a for loop, and both VIs may or may not run for same number of iterations. My goal is to read the values at each terminal inside the loop of both sub VIs, in the Main VI. I tried to achieve it using Global Variables, but in main VI it displays only the last iteration value from both sub VIs. Could anyone please tell me whrere am I going wrong? Is there any other/better way to achieve this.
    I appreciate any input on this issue.  
    Kudos are (always) welcome for the good post. :-)
    Solved!
    Go to Solution.

    Dennis,
                In attached VI, I can see the values changing in the sub VI from the main VI with the numeric indicator whose reference is passed on to the sub VI. Now if I wanted to store or use those values how do I do that? I tried to chnge the indicator to control and read from it (in the attached VI) , but the the indicator updates only once. Tried to create a property node and read the Value from it and it didn't work either.
    Thanks in Advance!
    -Nilesh
    Kudos are (always) welcome for the good post. :-)
    Attachments:
    main-1.vi ‏8 KB
    sub-1.vi ‏9 KB

  • How to get return values from task flow in af:region ?

    Hi!
    I'm working with a taskFlow that is rendered inside a popup using the "popup inside a region pattern" (http://www.oracle.com/technology/products/adf/patterns/popupregionpattern.pdf), but now this taskFlow has an input parameter and a return value definition. So the question is how to get a value returned by this taskFlow thas is called inside a region?
    Any suggestion?
    Thanks in advance!

    Hi,
    write the value to a shared memory scope like session and read it in the regionNavigation listener. If you follow the paper you refer to then the listener determines of the viewId is null, this a return happens. It wuld then look in the memory scope for the return value.
    Another option would be to use an object that you pass as an argument to the task flow you open in the popup. Then you change the object you passed in, which then makes the return information available in teh calling flow. The object you pass in would have to be in a shared scope too
    Frank

  • How to get each value from a parameter passed like this '(25,23,35,1)'

    Hi
    One of the parameter passed to the function is
    FUNCTION f_main_facility(pi_flag_codes VARCHAR2) return gc_result_set AS
    pi_flag_codes will be passed a value in this way '(25,23,35,1)'
    How to get each value from the string
    like 25 first time
    23 second time
    35 third time
    1 fourth time
    I need to build a select query with each value as shown below:-
    (SELECT t2.org_id, t4.description
    from org_name t2, ref_org_name t3, code_table t4
    where t2.att_data = t4.code
    and t3.ref_code = t2.att_type
    and t2.att_type = 25 and t3.code_type = t4.code_type
    and to_date('01-JAN-10', 'DD-MON-YY') between t2.att_start_date AND t2.att_end_date) q1,
    (SELECT t2.org_id, t4.description
    from org_name t2, ref_org_name t3,code_table t4
    where t2.att_data = t4.code
    and t3.ref_code = t2.att_type
    and t2.att_type = 23 and t3.code_type = t4.code_type
    and to_date('01-JAN-10', 'DD-MON-YY') between t2.att_start_date AND t2.att_end_date) q2,
    (SELECT t2.org_id, RTRIM(xmlagg(xmlelement(e, t4.description || ';')
    ORDER BY t4.description).EXTRACT('//text()'), ';') AS DESCRIPTION
    from org_name t2, ref_org_name t3,code_table t4
    where t2.att_data = t4.code
    and t3.ref_code = t2.att_type
    and t2.att_type = 35 and t3.code_type = t4.code_type
    and to_date('01-JAN-10', 'DD-MON-YY') between t2.att_start_date AND t2.att_end_date
    group by t2.org_id) q3,
    (SELECT t2.org_id, t4.description
    from org_name t2, ref_org_name t3, code_table t4
    where t2.att_data = t4.code
    and t3.ref_code = t2.att_type
    and t2.att_type = 1 and t3.code_type = t4.code_type
    and to_date('01-JAN-10', 'DD-MON-YY') between t2.att_start_date AND t2.att_end_date) q4
    Please help me with extracting each alue from the parm '(25,23,35,1)' for the above purpose. Thank You.

    chris227 wrote:
    I would propose the usage of regexp for readibiliy purposes and only in the case if this doesnt perform well, look at solutions using substr etc.
    select
    regexp_substr( '(25,23,35,1)', '\d+', 1, 1) s1
    ,regexp_substr( '(25,23,35,1)', '\d+', 1, 2) s2
    ,regexp_substr( '(25,23,35,1)', '\d+', 1, 3) s3
    ,regexp_substr( '(25,23,35,1)', '\d+', 1, 4) s4
    from dual 
    S1     S2     S3     S4
    "25"     "23"     "35"     "1"In pl/sql you do something like l_val:= regexp_substr( '(25,23,35,1)', '\d+', 1, 1);
    If t2.att_type is type of number you will do:
    t2.att_type= to_number(regexp_substr( '(25,23,35,1)', '\d+', 1, 1))Edited by: chris227 on 01.03.2013 08:00Sir,
    I am using oracle 10g.
    In the process of getting each number from the parm '(25,23,35,1)' , I also need the position of the number
    say 25 is at 1 position.
    23 is at 2
    35 is at 3
    1 is at 4.
    the reason I need that is when I build seperate select for each value, I need to add the query number at the end of the select query.
    Please see the code I wrote for it, But the select query is having error:-
    BEGIN
    IF(pi_flag_codes IS NOT NULL) THEN
    SELECT length(V_CNT) - length(replace(V_CNT,',','')) FROM+ ----> the compiler gives an error for this select query : PLS-00428:
    *(SELECT '(25,23,35,1)' V_CNT  FROM dual);*
    DBMS_OUTPUT.PUT_LINE(V_CNT);
    -- V_CNT := 3;
    FOR L_CNT IN 0..V_CNT LOOP
    if L_CNT=0 then
    V_S_POS:=1;
    V_E_POS:=instr(pi_flag_codes, ',', 1, 1)-1;
    else
    V_S_POS:=instr(pi_flag_codes,',',1,L_CNT)+1;
    V_E_POS:=instr(pi_flag_codes, ',', 1, L_CNT+1)-V_S_POS;
    end if;
    if L_CNT=V_CNT then
    V_ID:=TO_NUMBER(substr(pi_flag_codes,V_S_POS));
    else
    V_ID:=TO_NUMBER(substr(pi_flag_codes,V_S_POS,V_E_POS));
    end if;
    VN_ATYPE := ' t2.att_type = ' || V_ID;
    rec_count := rec_count +1;
    query_no := 'Q' || rec_count;
    Pls help me with fetching each value to build the where cond of the select query along with the query number.
    Thank You.

  • How to get selected value from selectOneRadio ???

    Hi...i want to how to get selected value from selectOneRadio and use it in another page and in backing bean.
    Note i have about 10 selectOneRadio group in one page i want to know value of each one of them.
    Plzzzzzzzz i need help

    You have a datatable in which each row is a question, correct?
    Also in each row you have 5 possible answers that are in a radio, correct?
    So,
    You need to put in your datatable model, a question, and a list of answers (5 in yor case) and the selected one.
    So you will have a get to the question, an SelectItem[] list to populate the radios and another get/set to the selected question.
    ex:
    <h:selectOneRadio value="#{notas.selectedString}" id="rb">
    <f:selectItem itemValue="#{notas.valuesList}"/>
    </h:selectOneRadio>
    Search the web for examples like yours.

  • How to get column value from DB grid

    Hi!
    I wander how to get col value from GridControl?
    My app consists of one rowsetinfo with two
    columns CODE and DESCRIPTION and a jbutton
    titled SELECT. When user clicks SELECT button
    the app should show the value of the CODE col
    of the selected row in GridControl.
    I wander how to make this action ?
    XxpsTransTimesMasterIter.setAttributeInfo( new AttributeInfo[] {
    CODEXxpsTransTimesMasterIter,
    DESCRIPTIONXxpsTransTimesMasterIter} );
    XxpsTransTimesMasterIter.setName("XxpsTransTimes");
    XxpsTransTimesMasterIter.setQueryInfo(new QueryInfo(
    "XxpsTransTimesMasterIterViewUsage",
    "lov.XxpsTransTimes",
    "CODE, DESCRIPTION",
    "XXPS_TRANS_TIMES",
    null,
    null
    ));

    Hi,
    You could attach an ActionListener on the JButton, and try the following code :
    NavigationManager fm = NavigationManager.getNavigationManager();
    DataItem dataItem = fm.getFocusedControl().getDataItem();
    ImmediateAccess col_code = null;
    String code = null;
    if (dataItem != null && dataItem instanceof RowsetAccess) {
    RowsetAccess rowset = (RowsetAccess)dataItem;
    try {
    col_code = (ImmediateAccess) rowset.getColumnItem("CODE");
    code = col_code.getValueAsString();
    } catch (DuplicateColumnException de) {
    return;
    } catch (ColumnNotFoundException ce) {
    return;
    } catch (SQLException se) {
    return;
    JTextField tf = new JtextField();
    tf.setText(code);
    I haven't tested this code.
    I am curious to know, the Object type of the dataItem.If it doesnot happen to be RowsetAccess ..try.. ScrollableRowsetAccess OR ImmediateAccess.
    Your code would change accordingly, depending on the instance.Refer to the product documentation for this.
    Do let me know, if this works.
    TIA
    Sandeep

  • How to get string value from xml in JSF??

    In JSF How to get string value from xml, .ini and properties file. I want to get string value from xml or text to JSF

    Just use the appropriate API's for that. There are enough API's out which can read/parse/write XML, ini and properties files. E.g. JAXP or DOM4J for xml files, INI4J for ini files and Sun's own java.util.Properties for propertiesfiles.
    JSF supports properties files as message bundle and resource bundle so that you can use them for error messages and/or localization.

  • How to get selected value from OADefaultListBean.

    Hi All,
    How to get selected value from OADefaultListBean ?
    Thanks,

    Hi,
    To identify the user's selection(s) when the page is submitted, you would add the following logic to your processFormRequest() method:
    OADefaultListBean list =
    (OADefaultListBean)webBean.findChildRecursive("positionsList");
    String name = list.getName();
    String[] selectedValues = pageContext.getParameterValues(name);
    To retrieve all the values in the list box, call list.getOptionsData().
    --Prasanna                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to get attribute value from standard page ?

    Hi,
    How to get attribute value from standard page ?
    String str = (String)vo.getCurrentRow().getAttrbute("RunId");
    But this value is returning a null value ....
    Can anyone help me to get this attribute value which is actually having a actual value .

    getCurrentRow() would always return null if no setCurrentRow() is used.
    Please check the page design and understand how many rows of VO are there. You can also use the following to get the row:
    vo.reset();
    vo.next();
    Regards
    Sumit

  • How to get real value from selectOneChoice with javascript?

    Hi,
    How to get real value from selectOneChoice with javascript? The event.getNewValue() only gets me the index of the selected item, not the value/title.
    JSF page:
    <af:resource type="javascript">
    function parseAddress(event)
    alert("new value: " + event.getNewValue());
    </af:resource>
    <af:selectOneChoice label="Location:" value="" id="soc4">
    <af:clientListener type="valueChange" method="parseAddress" />
    <f:selectItems value="#{Person.locations}" id="si7"/>
    </af:selectOneChoice>
    HTML :
    <option title="225 Broadway, New York, NY-10007" selected="" value="0">225 Broadway (Central Office)</option>
    <option title="90 Mark St., New York, NY-10007" value="1">90 Mark St. (Central Office)</option>
    Thanks a lot.

    Something I was missing ,
    You need to add valuePassThru="true" in your <af:selectOneChoice component. I have personally tested it and got the actual value in alert box. I hope this time you got the real solution. You can also test the following code by your end.
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document id="d1">
    <af:form id="f1">
    <af:panelBox text="PanelBox1" id="pb1">
    <af:selectOneChoice label="Set Log Level" id="soc1"
    value="#{SelectManagedBean.loggerDefault}"
    valuePassThru="true">
    <af:selectItem label="select one" value="First" id="s6"/>
    <af:selectItem label="select two" value="Second" id="s56"/>
    <af:clientListener method="setLogLevel" type="valueChange"/>
    </af:selectOneChoice>
    <af:resource type="javascript">
    function setLogLevel(evt) {
    var selectOneChoice = evt.getSource();
    var logLevel = selectOneChoice.getSubmittedValue();
    // var logLevelObject = AdfLogger.NONE;
    alert("new value is : " + logLevel);
    //alert(evt.getSelection);
    //alert(logLevelObject);
    evt.cancel();
    </af:resource>
    </af:panelBox>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>

  • How to get parameter value from report in event of value-request?

    Hi everyone,
    The customer want to use particular F4 help on report, but some input value before press enter key are not used in event of "at selection-screen on value-request for xxx", How to get parameter value in this event?
    many thanks!
    Jack

    You probably want to look at function module DYNP_VALUES_READ to allow you to read the values of the other screen fields during the F4 event... below is a simple demo of this - when you press F4 the value from the p_field is read and returned in the p_desc field.
    Jonathan
    report zlocal_jc_sdn_f4_value_read.
    parameters:
      p_field(10)           type c obligatory,  "field with F4
      p_desc(40)            type c lower case.
    at selection-screen output.
      perform lock_p_desc_field.
    at selection-screen on value-request for p_field.
      perform f4_field.
    *&      Form  f4_field
    form f4_field.
    *" Quick demo custom pick list...
      data:
        l_desc             like p_desc,
        l_dyname           like d020s-prog,
        l_dynumb           like d020s-dnum,
        ls_dynpfields      like dynpread,
        lt_dynpfields      like dynpread occurs 10.
      l_dynumb = sy-dynnr.
      l_dyname = sy-repid.
    *" Read screen value of P_FIELD
      ls_dynpfields-fieldname  = 'P_FIELD'.
      append ls_dynpfields to lt_dynpfields.
      call function 'DYNP_VALUES_READ'
        exporting
          dyname     = l_dyname
          dynumb     = l_dynumb
        tables
          dynpfields = lt_dynpfields
        exceptions
          others     = 1.
      check sy-subrc is initial.
    *" See what user typed in P_FIELD:
      read table lt_dynpfields into ls_dynpfields
        with key fieldname = 'P_FIELD'.
    *" normally you would then build your own search list
    *" based on value of P_FIELD and call F4IF_INT_TABLE_VALUE_REQUEST
    *" but this is just a demo of writing back to the screen...
    *" so just put the value from p_field into P_DESC plus some text...
      concatenate 'This is a description for' ls_dynpfields-fieldvalue
        into l_desc separated by space.
    *" Pop a variable value back into screen
      clear: ls_dynpfields.
      ls_dynpfields-fieldname  = 'P_DESC'.
      ls_dynpfields-fieldvalue = l_desc.
      append ls_dynpfields to lt_dynpfields.
      call function 'DYNP_VALUES_UPDATE'
        exporting
          dyname     = l_dyname
          dynumb     = l_dynumb
        tables
          dynpfields = lt_dynpfields
        exceptions
          others     = 0.
    endform.                                                    "f4_field
    *&      Form  lock_p_desc_field
    form lock_p_desc_field.
    *" Make P_DESC into a display field
      loop at screen.
        if screen-name = 'P_DESC'.
          screen-input = '0'.
          modify screen.
          exit.
        endif.
      endloop.
    endform.                    "lock_p_desc_field

Maybe you are looking for

  • How can I export an iMove Project if the Event file was deleted?  (Missing Media error message)

    Deep iMovie question: I accidentally deleted various EVENT files from my iMove EVENTS folder.  Yes, they are really gone ... this is NOT a matter of restoring them from the trash. The projects are still there ... I can still watch the projects as lon

  • PC shuts off when Ipod Touch is connected.  Detects "Digital Still Camera"

    My Ipod Touch was working fine until today. I plugged it into my PC and then it detects it as a "digital still camera". Then after a few seconds my PC will completely shut down. The weird thing is that once it restarts with the Ipod connected already

  • Vendor Bill no.  entry field

    Dear SAP experts what is the standard field for storing vendor bill no. while processing miro, fb60. in order to avoid duplicate invoice entry , if we enter bill number in reference field in document header then best practice will be to enter one bil

  • Skype Number to yearly basis

    I'd like to change monthly payment of Skype Number to yearly basis. How can I do? Solved! Go to Solution.

  • Cast to date

    hi to all, I need to change the variable type from varchar to data; I prefer to do this in the .RPD, in the 'Business Model and Mapping' layer. I've created a new logical column as: CAST ( SUBSTRING(Commerciale.FACT_USCITA.Data_Pagamento_Cont FROM 1