How to pass the javascript variable value to a jsp

Hi
I am trying to set a javascript variable with onClick event of a radio button in jsp
and I am assigning this variable to a hidden property in JSP whic has the corresponding getter an setter method in form.
But I am not able to retrtieve the value assigned in either form/action .can any body help me in this:
The code is
<script language="javascript">
var jais="";
     function setValue(val)
          jais=val;
     document.o.value=jais;
</script>
     <html:hidden property="o" value=""/>
<input type=radio name="1"
                                        value="xyz"
                                                                      onclick="setValue('XYZ')" >
                                        ABC                                        
and in the correspoding form bean I have
private String o_val =null;
public String geto()
return o_val;
public void seto(String strs)
o_val=strs;
In the action I am trying to access
by
1)String j=((form name)form.geto();
2)String j=request.getParameter("o")
but with both of them I am getting the value null
Thanks in Advance

You need to set the value of the hidden field in your function.
Setting an unrelated variable will not help.
function setValue(val)
document.forms[0].o.value = val;
also your get/set methods should be getO() and setO().

Similar Messages

  • How to pass the bind variable value to the sql statement of the LOV

    Hi,
    I am using Forms 10g builder.
    I have a text item which will be populated by a LOV when i press a button, but i have a bind variable in the SQL statement of the LOV. That bind variable should be replaced by a value which is derived from a radio group in the same data block.
    For Ex: ( )radio1 ( )radio2
    before i click on the push button, I'll select one of the radio button above,so my question is how to assign this radio group value to the bind variable in the sql statement in the LOV?
    Pl any hint is appreciated!
    Thanks
    Reddy

    The variable can be taken into account in the SELECT order contained in the Record Group used by the LOV.
    e.g. Select ... From ... Where column = :block.radio_group ...Francois

  • How to pass a JavaScript variable into a java method

    I would like to know how to pass a JavaScript variable into a java method with in a <% %> tag inside a JSP file like so:
    <%@ page contentType="text/html;charset=windows-1252"%>
    <html>
    <head>
    <script LANGUAGE="JavaScript">
    myValue = someDynamicValue;
    <% System.out.println(myValue)%>
    </script>
    </head>
    <body>
    </body>
    </html>
    obviously "System.out.println(myValue)" will not work because myValue is seen as a java variable and not a JavaScript variable.
    I would like to know how to let the jsp file, that I wrote in the above code, see myValue as a JavaScript variable and not a java variable so that I can pass it to a java method.
    NOTE: the java method does not have to be a println() method, it can be any method of my choice.
    NOTE: someDynamicValue is a JavaScript value that can dynamically change

    I don't believe you can. JSPs are really just elaborate templates that an engine such as Tomcat parses and generates an HTML page based on. That page is then displayed to the user. By the time you want to use some function in Javascript, the JSP has already been parsed and generated.
    Basically, Javascript and JSPs can't talk to each other. One's server-side and the other is client-side.

  • How to pass the USER variable to RPD in 11g?

    I am trying to figure out how to pass the USER variable to the RPD in 11g.
    In 10g, I had define an intializtion block to store the USER variable and pass it to a statement that has to be executed before the query is executed.
    We use the Oracle VPD technology that allows to restrict data access. This is the statement that has to be executed before a query can run.
    select vpd_adwh.setclnvpdcontext_fnc('VALUEOF(NQ_SESSION.cuser)', UPPER(:USER))) from dual
    That is the 10g version and it works fine.
    In 11g, I tried to use
    select vpd_adwh.setclnvpdcontext_fnc('VALUEOF(NQ_SESSION.cuser)', UPPER('VALUEOF(NQ_SESSION.USER)')) from dual
    but this is not working.
    Any help?

    any ideas?

  • How to pass the FORM Fields value by Form Personalization

    Hi ALL,
    I want to pass form filds values in to procedure. I am calling this procedure through form personalization of that form..... But it's not accepting any form field's value there... when i am passing hardcoded vales procedure is executing fine...
    can any one suggest what to do???
    i tried with these syntax
    TEST_EMP_FP(:ADDR.ADDRESS_ID,'ABC')
    TEST_EMP_FP(${item.ADDR.ADDRESS_ID.value},'ABC')
    Regards
    Ravi

    Hi,
    Iam calling an SRS from forms personlization. Can any body tell me how to pass the Form field values as parameters to the Reports. (Example when they call this Concurrent request from Transact5ions screen, The invoice number should be defaulted in the report parameter).
    Regards,,
    Anil.

  • Passing the sh variable value to input of  to Pl/SQL Procedure

    Hi All,
    My doubt is how can I pass the sh variable (.i.e file name stored in sh variable called($F)) as a input of below mention procedure (YODEL_XL_INS_SDG_COMMER_PROD)
    for F in *.dat; do
    echo $F
    #sqlldr apps/apps control=$CONTROL data=$F
    # Below Part is used for Add the file name into table
    cat $CONTROL| sed "s/:FILE/$F/g" > $F.ctl
    sqlldr apps/apps control=$F.ctl log=$F.log bad=$F.bad discard=$DISCARD data=$F
    sqlplus -s apps/apps << EOF
    spool Yodel_xl_om_inven_items_pkg.txt
    set serveroutput on;
    DECLARE
    X_Error_Code VARCHAR2(1000);
    X_Error_Message VARCHAR2(1000);
    X_Status VARCHAR2(1000);
    BEGIN
         YODEL_XL_INS_SDG_COMMER_PROD($F,'SDG',X_Status,X_Error_Code,X_Error_Message);
    END;
    SHOW ERRORS;
    spool off;
    exit
    EOFDG_COMMER_PROD($F,'SDG',X_Status,X_Error_Code,X_Error_Message);
    If i'm passing directly then getting below error.
    YODEL_XL_INS_SDG_COMMER_PROD(SDG_Testing_produsts3.dat,'SDG',X_Status,X_Error_Code,X_Error_Message);
    ERROR at line 8:
    ORA-06550: line 8, column 66:
    PLS-00201: identifier 'SDG_Testing_produsts3.dat' must be declared
    ORA-06550: line 8, column 2:
    PL/SQL: Statement ignored
    No errors.
    Could you please help me to resolve this.
    Edited by: user9077611 on 30-Aug-2012 10:11

    user9077611 wrote:
    Hi All,
    My doubt is how can I pass the sh variable (.i.e file name stored in sh variable called($F)) as a input of below mention procedure (YODEL_XL_INS_SDG_COMMER_PROD)
    for F in *.dat; do
    echo $F
    #sqlldr apps/apps control=$CONTROL data=$F
    # Below Part is used for Add the file name into table
    cat $CONTROL| sed "s/:FILE/$F/g" > $F.ctl
    sqlldr apps/apps control=$F.ctl log=$F.log bad=$F.bad discard=$DISCARD data=$F
    sqlplus -s apps/apps << EOF
    spool Yodel_xl_om_inven_items_pkg.txt
    set serveroutput on;
    DECLARE
    X_Error_Code VARCHAR2(1000);
    X_Error_Message VARCHAR2(1000);
    X_Status VARCHAR2(1000);
    BEGIN
         YODEL_XL_INS_SDG_COMMER_PROD($F,'SDG',X_Status,X_Error_Code,X_Error_Message);
    END;
    SHOW ERRORS;
    spool off;
    exit
    EOFDG_COMMER_PROD($F,'SDG',X_Status,X_Error_Code,X_Error_Message);
    If i'm passing directly then getting below error.
    YODEL_XL_INS_SDG_COMMER_PROD(SDG_Testing_produsts3.dat,'SDG',X_Status,X_Error_Code,X_Error_Message);
    ERROR at line 8:
    ORA-06550: line 8, column 66:
    PLS-00201: identifier 'SDG_Testing_produsts3.dat' must be declared
    ORA-06550: line 8, column 2:
    PL/SQL: Statement ignored
    No errors.
    Could you please help me to resolve this.
    Edited by: user9077611 on 30-Aug-2012 10:11You know that strings should be enclosed in single quote marks.
    Right?

  • How to get the session variable value in JSF

    Hi
    This is Subbus, I'm new for JSF framewrok, i was set the session scope for my LoginBean in faces-config.xml file..
    <managed-bean-name>login</managed-bean-name>
    <managed-bean-class>LoginBean</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope> like that...
    So all parameter in LoginBean are set in session right ?... for example i used userId is the Parameter...
    Now i need to get the the userId parameter from that session in my another JSP page.. how i get that ?..
    Already i tried
    session.getAtrribute("userId");
    session.getValue("userId");
    but it retrieve only "null" value.. could u please help me.. it's very urgent one..
    By
    Subbus

    Where i use that..is it in jsp or backend bean...
    simply i use the following code in one backend bean and try to get the value from there bean in the front of jsp page...
    in LogoutBean inside
    public String getUserID()
         Object sessionAttribute = null;
         FacesContext facescontext=FacesContext.getCurrentInstance();
         ExternalContext externalcontext=facescontext.getExternalContext();
         Map sessionMap=externalcontext.getSessionMap();
         if(sessionMap != null)
         sessionAttribute = sessionMap.get("userId");
         System.out.println("Session value is...."+(String)sessionAttribute);
         return (String)sessionAttribute;
         return "fail";
    JSP Page
    <jsp:useBean id="logs" scope="session" class="logs.LogoutBean" />
    System.out.println("SS value is ...."+logs.getUserID());
    but again it retrieve only null value.. could u please tell me first how to set the session variable in JSF.. i did faces-config only.. is it correct or not..
    By
    Subbus

  • How to have the BIND variables value using the TKPROF utility.

    WE have a JAVA application and Oracle 9i database.We need to figure out what all select/update/insert sql staements are firing if i am doing one complete processing in my JAVA front application.
    Initally I have planned for using TKPROF utility after makeing AUTO_TRCE=TRUE in the database.But the problem is that all select/insert/update sql statements are using the BIND variables in the JAVA code and same is coming/printing on the trace file also.
    can we print out the BIND variables values also,while making the TRACE ON?
    eg: trace is generaitng the all insert statements like below.
    insert into TEST(Column1,Column2) values(:1,:2);
    I want to know the value of :1 and :2 bind variables.
    If you have any cluse about it please let me know.
    Mitesh Shah

    Thanks Guys,
    I got the BIND variable values in the TRACE file.Previously i was searching on the OUtputfile.
    I am pasting the same trce file format.Can you please verify it.Is i am looking the correct file and corect location.
    PARSING IN CURSOR #2 len=1571 dep=0 uid=66 oct=3 lid=66 tim=18446744071740803342 hv=1462188955 ad='123434f0'
    SELECT PARENTIDKEY,CONTRACTKEY,COMPANYKEY,BACKENDKEY,DATAREP,BANKHOLDINGID,BANKID,CARRIERPARTYID,PRODUCTID,ID,PREMIUMINDEXRATE,ILLUSTRATEDMATURITYLOW,ILLUSTRATEDMATURITYHIGH,SPECIALHANDLING,CARRIERCOMMCODE,MONEYTRANSFERTYPE,FIRSTBILLSKIPMONTH,CONTESTABILITYENDDATE,DEDUCTIONDATE,MARKETVALADJUSTIND,FREEAVAILABLEAMT,ADVANCINGREJECTEDIND,RATEDIND,OTHERINSUREDIND,ENDORSEMENTIND,BENEFICIARYIND,CASECONTROLNUMBERASSUMING,OWNERLEGALNAME,STAMPDUTY,COMMISSIONANNUALIZEDIND,NONSTDCOMMTAKEN,LAPSETAXABLEGAIN,GOVTALLOTMENTSUSPENSEACCTAMT,LASTNOGOODCHECKREASON,LASTNOGOODCHECKDATE,LASTCOIDATE,LASTDEDUCTEDEXPENSECHARGES,LASTDEDUCTEDCOICHARGES,STATEMENTBASIS,LASTNOTICETYPE,LASTNOTICEDATE,PAYMENTDUEDATE,LASTBANKCHANGEDATE,EFTENDDATE,BANKBRANCHNAME,BANKNAME,PAYMENTDRAFTDAY,BANKACCTTYPE,CREDITCARDTYPE,CREDITCARDEXPDATE,ACCTHOLDERNAME,ROUTINGNUMBER,ACCOUNTNUMBER,PAYMENTMETHOD,ANNUALPAYMENTAMT,PAYMENTAMT,PAYMENTMODE,LASTCOIANNIVDATE,BILLINGSTOPDATE,BILLEDTODATE,FINALPAYMENTDATE,GRACEPERIODENDDATE,PAIDTODATE,STATUSCHANGEDATE,REINSTATEMENTDATE,TERMDATE,ISSUEDATE,EFFDATE,DOWNLOADDATE,DURATION,POLFEE,POLICYVALUE,COMMISSIONROLLOVERPCT,COMMISSIONOPTIONSELECTED,REPLACEMENTTYPE,CUSIPNUM,CONVERTTOPRIVATEIND,PORTABILITYIND,REINSURANCEIND,BILLNUMBER,JURISDICTION,ISSUETYPE,ISSUENATION,STATUSREASON,PRIORPOLICYSTATUS,POLICYSTATUS,SHORTNAME,ADMINISTERINGCARRIERCODE,PLANNAME,FILEDFORMNUMBER,FORMNO,CARRIERCODE,PRODUCTCODE,PRODUCTTYPE,LINEOFBUSINESS,CERTIFICATENO,POLNUMBER,CARRIERADMINSYSTEM FROM "POLICY" WHERE PARENTIDKEY = :1 AND CONTRACTKEY = :2 AND COMPANYKEY = :3 AND BACKENDKEY = :4
    END OF STMT
    PARSE #2:c=0,e=1298,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=0,tim=18446744071740803336
    BINDS #2:
    bind 0: dty=1 mxl=4000(4000) mal=00 scl=00 pre=00 oacflg=01 oacfl2=0 size=4000 offset=0
    bfp=082a5a9c bln=4000 avl=09 flg=05
    value="Holding_1"
    bind 1: dty=1 mxl=4000(4000) mal=00 scl=00 pre=00 oacflg=01 oacfl2=0 size=4000 offset=0
    bfp=082a4af0 bln=4000 avl=10 flg=05
    value="DUL001138U"
    bind 2: dty=1 mxl=4000(4000) mal=00 scl=00 pre=00 oacflg=01 oacfl2=0 size=4000 offset=0
    bfp=069bb890 bln=4000 avl=02 flg=05
    value="00"
    bind 3: dty=1 mxl=4000(4000) mal=00 scl=00 pre=00 oacflg=01 oacfl2=0 size=4000 offset=0
    bfp=069ba8e4 bln=4000 avl=04 flg=05
    value="CLIF"
    **********************************************************************************

  • How to get the anchor tag values in next jsp

    Hey all,
    I have two jsp files.
    in first jsp,
    I am getting the resultset.
    I am setting the resultset to the anchor tag.
    below is the code...
    <a target="_top" rel="contents" rev="contents" class="fordynamiclabel" href="ASCMasterTwo.jsp"><%=rSet.getString(1) %></a></td>
    whenever he click on any anchor tag,
    It will goes to ACSMasterTwo.jsp page for edit the compleate record.
    how to get the anchor tag value in that page...
    Please help me on this.

    You have to pass a parameter. An id is good.
    Of course you have to get an id from somewhere in the result set right?
    <a target="_top" rel="contents" rev="contents" class="fordynamiclabel" href="ASCMasterTwo.jsp?id=<%= rSet.getString("id") %>"><%=rSet.getString(1) %></a></td>Then you call
    request.getParameter("id");
    and look up the values related to that id in the database.

  • How to pass a javascript variable to a query in BEx?

    Hi All,
    We're using BEx SAP BW 3.x
    I'm using portal eventing to pass a variable to a BW template.  While I can pick up this value using javascript, I do not know how to pass it to the query.
    Let me just say, I am new to BEx, so any guidance you could give me would be most welcome.
    Thanks in advance,
    Liz.

    Hi,
    Perhaps this JavaScript can help?
    document.appletName.getQueryObject().setParam(1, param value);
    Call this peice of code on some event, for example the click event of a Button.
    There are many more examples on this forum, search for more.
    Regards,
    Michael

  • How to pass a javascript variable to a javabean method

    Hi
    I need to pass a String from a Javascript argument to a javabean method. localUrl will be instantiated with a string not from any form item(option box, textbox, etc) so cannot use
    String param = request.getParameter("XXX").
    My code below does not work as localUrl is not seen by javaBean and returns a null.
    function ShowWaitDisplay(localUrl)
    var Description = <%=RandomFeeds.getDescription(localUrl)%>;
    //Do something with the string Description
    Thanks
    Andrew

    Since, java bean code will be executed on the server side and java script executes on client side, by the time your javascript variable created, the bean code is already been executed.

  • How to pass the check box values from one view to another view

    Hi Experts,
    I have a selection screen view which consists of check boxes.
    WBS System status.
    Release                      Completed                  Closed as 3 check boxes.
    Note : The above ones are check boxes.
    Based on the selection made by the user, those values needs to be passed to second view which retrieves the data and
    displays the data accordingly.
    At the same time if the user does not make any selection, then WBS System status should contain Released, Completed and Closed values and that needs to be sent to Second view.
    Kindly advise.
    Regards,
    Chitrasen

    hi ,
    make a attribute of type WDY_BOOLEAN to achieve this functionality
    u need to follow these steps :
    1 in side ur component controller , under the ATTRIBUTES tab , make 3 attributes say attr1 , attr2 and attr3 of type WDY_BOOLEAN
    2 create a context node , cn_check and 3 context attribute ca_check1 , ca_check2 and ca_check3 in ur first view for
    release , complete and close check boxes
    3 inside the DOINIT of ur 1st view , set the attributes attr1 , attr2 and attr3 to blank
    wd_comp_controller->attr1 = ' '
    wd_comp_controller->attr2 = ' '
    wd_comp_controller->attr3 = ' '
    4 inside the method , where u r validating , if the check boxes are checked or not , read the attributes ca_check1 , ca_check2 and
    ca_check3
      DATA lo_nd_cn_check TYPE REF TO if_wd_context_node.
        DATA lo_el_cn_check TYPE REF TO if_wd_context_element.
        DATA ls_cn_check TYPE wd_this->element_cn_check.
        DATA lv_ca_check1 LIKE ls_cn_check-ca_check1.
    *   navigate from <CONTEXT> to <CN_CHECK> via lead selection
        lo_nd_cn_check = wd_context->get_child_node( name = wd_this->wdctx_cn_check ).
    *   get element via lead selection
        lo_el_cn_check = lo_nd_cn_check->get_element(  ).
    *   get single attribute
        lo_el_cn_check->get_attribute(
          EXPORTING
            name =  `CA_CHECK`
          IMPORTING
            value = lv_ca_check1 ).
    IF lv_ca_check1 EQ 'X' .
    wd_comp_controller->attr1 = ' X'
    wd_comp_controller->attr2 = 'X '
    wd_comp_controller->attr3 = ' X'

  • How to retain the presentation variable values for Dashboard Prompt

    I've a dashboard prompt with date and two other drop down field, with default value as yesterday's date set for date and All Values set for other two drop down list. Presentation Variables are D1, P1 and P2 respectivilly
    I'm using GO URL from "Report A" and passing presentation variable to navigate to other report (Report B) that works fine. eg:
    '<a href = saw.dll?GO&path=/shared/Reports/ABC/ReportB&Action=Navigate&p0=1&p1=eq&p2="-%20Time"."Next%20Day"&p3=@{d1}>Test</a>'
    From Report B I'm using Dashoard URL to go back to Previous Report like:
    <div class="XUIPromptEntry minibuttonOn">
    Return to Previous Screen</div>
    This also works fine.
    My problem is that, when users selects different values in the Main dashboard prompt for date and other other two drop down and navigates to other report (Report B), and from Report B, when user returns to previous screen (Main Dashboard), Prompts values gets refreshed to original default values.
    Is there any way to retain the values of presentation variable in dashboard Prompt when I return to main dashboard from Report B?
    I'd appreciate your help.
    Thanks

    Change your dashboard url include the column and column value for the date column sample shown below,
    [a href=saw.dll?Dashboard&PortalPath=/shared/sample/_portal&page=pagename&Action=Navigate&col1=Dim.Date&val1=@1>Return to Previous Screen[/a>
    In my second report Date is the first column so I referenced it's value as @1 in the dashboard URL
    note: replace [ with <
    Thanks,
    Vino                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to use the same variable value for data entry and the planning sequence

    Hi,
    the scenario is the following:
    Using the WAD template a user enters cost center plan data. The cost center is selected by the chosen value for the variable "V1".
    Afterwards he shall push a button which starts a planning sequence (including saving the data and further functions). This planning sequence uses a filter that also contains the variable "V1".
    What or where has it to be defined that the planning sequence uses automatically the same value for the variable "V1" as selected for the data entry?

    You have to define in the planning function. The planning sequence is only a sequence and it read the planning functions underneath it.
    Ravi Thothadri

  • How to pass the repository variables in title view in obiee 11g

    all I am trying to create a reprot and the format of that report is
    TEST REPORT
    month range : 04/01/2012-04/30/2012.
    how can we get that date range in the title view.
    Any suggestions??

    Hi,
    For session variables:
    @{biServer.variables['NQ_SESSION.variablename' ]}
    For repository variables:
    @{biServer.variables['variablename']}
    Try this syntax in the title view it should work.

Maybe you are looking for