Passing values through javascript

hI gurus,
I have a javascript function
I open a new jspdynpage component in this window and pass a parametre along with it
name = "xyz", name keeps changing ,Its
function x(name)
window.open("irj/servlet/portal/prtroot/Appname.Componentname?param = name")
now when I do request.getparametre("param"), I get name , wherin I need xyz ...
how can I achieve this

Hi,
that shoud be a problem with the parenthesis, try this:
window.open("irj/servlet/portal/prtroot/Appname.Componentname?param="+name)
Romano

Similar Messages

  • Passing value from JavaScript window to form

    Hi,
    Coul'd You help me?
    I have a test form. I open new JavaScript window from this form. I generate list of authors in this window by the procedure show_list. I want to pass value from JavaScript window back to test form, but
    the command "window.opener.document.forms[idx_form].elements[idx_fld].value = val;"
    don't pass value to test form. Where is mistake?
    Thanks Vaclav
    -------------- test form --------------
    <HTML>
    <HEAD>
    <META http-equiv="Content-Type" content="text/html; charset=windows-1250">
    <TITLE>Edit</TITLE>
    <SCRIPT LANGUAGE="JavaScript">
    <!-- Comment out script for old browsers
    function get_list(frm, fld)
    var idx_form, idx_fld;
    idx_form = get_idx_form(frm);
    idx_fld = get_idx_field(idx_form, fld);
    var w = open ("http://vasekora/pls/portal309/ahs.RD_CISEL.SHOW_LIST" + "?startPg=1" + "&master_fld=" + "ID_AUTHOR" + "&slave_fld=" + "NAME" + "&ownr=" + "REDAKCE" + "&tbl_name=" + "AUTHORS" + "&cmd_qry=" +"" + "&idx_form=" + idx_form + "&idx_fld=" + idx_fld,"wn_Authors","width=500,height=600,resizable=yes,menubar=yes, location=yes");
    if (w.opener == null)
    w.opener = self;
    w.focus();
    function get_idx_form(p_form_name)
    var v_index, v_full_name, v_return;
    for(v_index=0; v_index < document.forms.length; v_index++)
    v_return = -1;
         v_full_name = document.forms[v_index].name.split(".");
    if (v_full_name == p_form_name)
         v_return = v_index;
              break;
    return v_return;
    function get_idx_field(idx_form, field_name)
    var v_index, v_full_name, v_return;
    for(v_index=0; v_index < document.forms[idx_form].length; v_index++)
    v_return = -1;
         v_full_name = document.forms[idx_form].elements[v_index].name.split(".");
    if (v_full_name == field_name)
         v_return = v_index;
              break;
    return v_return;
    //-->
    </SCRIPT>
    </HEAD>
    <BODY>
    <FORM NAME="f_aut_new" ACTION="javascript:testclose()" METHOD=POST TARGET="_blank">
    <INPUT TYPE="text" NAME="id_aut">
    <IMG SRC="images/list.gif" alt="Seznam" border="0" align=bottom><BR><BR>
    <INPUT TYPE="submit" VALUE="Save">
    <INPUT TYPE="reset" VALUE="Cancel">
    </FORM>
    </BODY>
    </HTML>
    -------------------- end test form --------------
    procedure show_list
    startPg integer,
    master_fld varchar2,
    show_fld varchar2,
    ownr varchar2,
    tbl_name varchar2,
    cmd_qry varchar2,
    idx_form integer,
    idx_fld integer
    is
    TYPE cur_typ IS REF CURSOR;
    c cur_typ;
    c_cnt cur_typ;
    i integer;
         pg rd_types.pages_t;
    odkaz varchar2(4000);
    bk_url varchar2(4000);
         s1 varchar2(4000);
         var_mfld integer;
         var_sfld varchar2(8000);
         bl boolean;
         var_cmd varchar2(2000);
    begin
    htp.HTMLOPEN;
    htp.HEADOPEN;
    htp.p('<SCRIPT LANGUAGE="JavaScript">');
    htp.p('<!-- Comment out script for old browsers');
    htp.p('function Close_List(val, idx_form, idx_fld)');
    htp.p('{');
    htp.p('window.opener.document.forms[idx_form].elements[idx_fld].value = val;');
    htp.p('self.close();');
    htp.p('}');
    htp.p('//-->');
    htp.p('</SCRIPT>');
    htp.HEADCLOSE;
    htp.BODYOPEN;
    if cmd_qry is null then
    s1 := 'SELECT a.'||master_fld||', a.'||show_fld||' FROM '||ownr||'.'||tbl_Name||
    ' a ORDER BY a.'||show_fld;
    else
    var_cmd := UPPER(cmd_qry);
    s1 := 'SELECT a.'||master_fld||', a.'||show_fld||' FROM '||ownr||'.'||tbl_Name||
    ' a WHERE UPPER(a.'||show_fld||') LIKE ''%'||var_cmd||'%'' ORDER BY a.'||show_fld;
    end if;
    i := 1;
    OPEN c FOR s1;
    LOOP
    FETCH c INTO var_mfld, var_sfld;
    IF c%FOUND THEN
    IF i >= pg.StartRec AND i <= pg.EndRec THEN
    odkaz :=''||var_sfld||'';
    htp.p(i||': '||odkaz||' ('||var_mfld||')<BR>');
    ELSE
         IF i > pg.EndRec THEN
         EXIT;
         END IF;          
    END IF;
    ELSE
    EXIT;
    END IF;
    i := i + 1;
    END LOOP;
    htp.p('<BR><B><INPUT TYPE=BUTTON ONCLICK="javascript:self.close();" VALUE="Close"></B><BR><BR>');
    CLOSE c;
    htp.BODYCLOSE;
    htp.HTMLCLOSE;
    end;

    If this makes any difference: Instead of using "var w = open..." try "var w = window.open..."

  • Return two columns values through Javascript

    In the same goal as:
    onclick="$s('P1_DEPTNO', #DEPTNO#); return false;"
    to return a column value through javascript, is it possible to return 2 values? Example:
    onclick="$s('P1_DEPTNO', #DEPTNO#); $s('P1_EMP, #EMPLOYEE#);return false;"
    Thanks all :)
    Max

    Maxime Carrier wrote:
    In the same goal as:"Goal"?
    onclick="$s('P1_DEPTNO', #DEPTNO#); return false;"
    to return a column value through javascript, is it possible to return 2 values? Example:
    onclick="$s('P1_DEPTNO', #DEPTNO#); $s('P1_EMP, #EMPLOYEE#);return false;"Have you tried it?
    This code contains a syntax error in the form of a missing quote. It should be:
    onclick="$s('P1_DEPTNO', #DEPTNO#); $s('P1_EMP', #EMPLOYEE#);return false;"It might also produce JS syntax errors if the <tt>#DEPTNO#</tt> and/or <tt>#EMPLOYEE#</tt> values are not numbers.
    onclick="$s('P1_DEPTNO', '#DEPTNO#'); $s('P1_EMP', '#EMPLOYEE#'); return false;"would therefore be safer (assuming the code is somewhere that <tt>#DEPTNO#</tt> and <tt>#EMPLOYEE#</tt> will be substituted).
    Your post is spectacularly lacking in context. Why do you want to do this? Where?
    When you have a problem you'll get a faster, more effective response by including as much relevant information as possible upfront. This should include:
    <li>Full APEX version
    <li>Full DB/version/edition/host OS
    <li>Web server architecture (EPG, OHS or APEX listener/host OS)
    <li>Browser(s) and version(s) used
    <li>Theme
    <li>Template(s)
    <li>Region/item type(s) (making particular distinction as to whether a "report" is a standard report, an interactive report, or in fact an "updateable report" (i.e. a tabular form)
    Following the guidelines in these documents will also help to explain the problem in much more detail and with sufficient background for it to be understood:
    <li>+How to ask questions+
    <li>+{message:id=9360002}+

  • Passing values from javascript in pop up window to parent jsp

    Hi
    I am trying to pass values from a pop up window to the main window that popped this child window , with the idea to have the parent window refresh itself with value from pop up window.But the values are not going through.I do a request on the hidden variable but when the parent
    jsp refreshes , the variable is still null...
    The following is the code i have .
    Parent jsp:a.jsp
    <form name='summary'>
    <input type=hidden name=customerid value="">
    <input type="button" class="textButton" name="action" value="customerlist" onClick="javascript:openWin('b.jsp','800','350')">
    <script>
    function openWin(loc, w, h) {
    var newWin = window.openloc,"HTML",'dependent=1,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=' + w + ',height=' + h);
    newWin.window.focus();
    </SCRIPT>
    <%
    String optionVal = request.getParameter("customerid");%>
    var user = "<%= optionVal%>";
    </form>
    child jsp- b.jsp (pop up window)
    <script>
    function closer(){
    var val = document.formname.id.selected.value;
    window.opener.document.summary.customerid.value = val;
    window.opener.location.reload();
    </script>
    <form name = formname>
    <input type="text" name="id" value = ''>
    <input type="button" class="textButton" value="select"
    onClick="closer();window.close();">
    </form>
    Any ideas on what i am missing
    Thanks
    Arn

    use window.opener.document.forms[0].filedname.value = 'value u need to set'

  • Passing value from javascript function to servlet

    Hello everybody,
    i need to pass parameter from javascript function to servlet.
    what i wrote is :
    function callPopulateServlet(t)
    var h =document.NewRequest.services;
    var y = t.selectedIndex;
    alert(h.options[y].value);
    var id=h.options[y].value;
    <%session.setAttribute("id",id);%> // am getting error at this point
    document.NewRequest.submit();
    with this id am quering values from database through servlet.
    any body knows plz help me.
    thanks,
    anil.

    this is the error am getting
    Stacktrace:
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:85)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
         org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:435)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:298)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:299)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

  • Passing values to Javascripts/ write to text file

    Hi,
    I m new to InDesign Programming. I m using InDesign CS3 on MAC OS...
    Is it possible to pass values to a javascript through plugin code?
    I have a dialog with textboxes in it, On clicking ok button a script is called which uses these text box values for processing. Is this possible or is this the only way: to write them into a text file and read the textfile in script....
    Someone Pls guide me...

    Are you looking for this:<br /><br />in C++ :<br />Utils<IScriptArgs>()->Set(yourkeyStr ,yourvalueStr );<br /><br />in JavaScript: <br />if(app.scriptArgs.isDefined(yourkeyStr)) {<br />     var yourvalueStr = app.scriptArgs.get(yourkeyStr)<br />}<br /><br />HTH,<br />Kamran

  • Passing values to javascript from database

    hi friends,
    I have to fetch values from the database and pass the values to the java script variable.
    I tried this, but is not working. When i place the script inside the java, it isnt working. Iam passing value to this script variable as argument to a function. This is my code:
    ResultSetMetaData rsmd = rs.getMetaData();
    int numberOfColumns = rsmd.getColumnCount();
    while (rs.next())
    for (int i = 1; i <= numberOfColumns; i++)
    count=count+1;
    if (i > 1)
    columnValue = rs.getString(i);
    %>
    <script>
    var hcbList = [<%=request.getParameter("columnValue")%>];
    </script>     
    <%           
    System.out.println("");
    st.close();
    %>
    Pls solve the problem. Its very urgent!
    thanx

    Keep this in mind: JSP is source generation software.
    In other words JSP generates the HTML and/or Javascript that will be rendered on the browser. So What you need to do is keep the JSP and Javascript separate in your mental picture. You ask yourself, "what would the finished Javascript code look like that would give me the results?" Then you apply JSP as a template to fill in the blanks. In your example you want a list or an array of values in your Javascript. I don't use Javascript to often but from memory I belive an array in Javascript is something like this:
    <script>
    var hcbList = {"val1", "val2, "valx"};
    </script>That's what the finished Javascript would look like. Now you apply JSP as a template.
    <!-- This is the fill-in-the-blank template
    <script>
    var hcbList = {<%=insertArrayHere%>};
    </script>Now you fill in the blanks
    //insertArrayHere is your blank
    String insertArrayHere = "";
    //iterate over the collection and build a string that represents the JS array
    for(int i = 1; i <= numberOfColumns; i++)
       //wrap each value with quotes if it is to be a JS string
       insertArrayHere += "\"" + rs.getString(i) + "\"" + ","; //terminate with a comma
    //trim the last comma off the array guts
    insertArrayHere = insertArrayHere.substring(0, insertArrayHere.length() - 1); Now I'm sure that's not exactly what you want because it looks like you got some crazyness going on in your logic. I don't know how you can query the using values from the database. Anyhow it poses as a good example of how to apply the concept of the two technologies. (Also, why are you doing a System.out from JSP? You should be calling log() if you want console output.) The whole idea is that JSP can NOT talk directly to Javascript. It can only generate Javascript dynamically before it is received by the browser.

  • How to pass value from Javascript function to a Java class method

    Hi All,
    I want to pass a value, which I catch in a Javascript function to a method in a Java class. I have tried many combinations but it gives me error.
    This is the way I am doing
    function assignBill() {
    proj = projPh.substring(0,indSlash);
    <% myproject.getProj(" project_cd = '" + proj + "'");%>
    proj is the variable which I want to pass to getProj methods.
    If any one has done this, please let me know. Thanks for your help.
    Ritesh Mehta

    The only way to receive something from clients page is to submit it somehow: through a form or link, but the info has to make it back to the server obviously. I dont know how your app works, but you can use the the javascript -location.href- function(i think) to submit the var to the server and process it there.

  • How to pass value from Javascript function to JSP ?

    hi,
    hello i have 2 jsp page and one external javascript page.
    from page 1.jsp
    i am calling a fuction named fun(1).and i am passing that value to external
    javascript page
    from external javascript.js
    i am getting this value in the fun(w) and sending this Page2.jsp like this
    var url = "page2.jsp?id ="+w;
    http.open("get","page2.jsp?id ="+w );
    and in page2.jsp
    i am getting that value like
    String k = request.getParameter("w");
    but this is showing error. how cloud i get that value on this page2.jsp ?
    plz any one help me to study this
    regards
    Vishnu Sankar S

    hello sir
    thank u very much..i got the output
    Message was edited by:
    vishnu_shankar

  • Pass value through URL without setting local page item

    Folks,
    I have a table where I have created a dummy column with a hyperlink on it to go to another page in the application which runs a report passing through columns on the table
    As I am doing this several times (for different pages in my application) - Is there a way of passing a variable through a URL to a report without setting a local variable
    i.e.
    Click Here
    Here I am assigning a local variable on Page 25 which is hidden called P25_TEST1
    What I would like to do is pass the value straight to page 25 (which runs the report) without the need to create hidden items on the report pages all the while
    Thanks
    Gareth

    You have a plain HTML page that loads with a url with something like ?field=value
    And you want "value" to show on your page, correct?
    <html>
    <body>
    <script>
    var qsParm = new Array();
    function qs() {
    var query = window.location.search.substring(1);
    var parms = query.split('&');
    for (var i=0; i<parms.length; i++) {
       var pos = parms<i>.indexOf('=');
       if (pos > 0) {
          var key = parms<i>.substring(0,pos);
          var val = parms<i>.substring(pos+1);
          qsParm[key] = val;
    qsParm['field'] = null;
    qs();
    if (qsParm['field'])
         document.write('You selected ' + qsParm['field'] );
    </script> 
    </body>
    </html>
    Call that as test.html?field=Hello
    Here's a nice link that explains it in detail: http://www.eggheadcafe.com/articles/20020107.asp

  • Passing values through command range

    Hi All,
    I am passing the values for costelement through command range in my workbook.
    User will give the value of the costelement and I am accessing the value in my planning function.
    But, is there a way wherin I can run the same  planning function taking all the values of the costelement in my infoprovider(not a single value and not multiple values for a costelemet which the user would select)? In such a case, what value can the user select in the command range for the costelement so that my planning function takes all the values in my infoprovider?
    Any help is highly appreciated.
    Regards,
    Srinivas Kamireddy.

    Hi Deepti,
    I have tried with the selection-options optional variable but it didn't work. I am able to pass a single value as in my earlier case where I was using a single value optional variable.
    But, when I pass a blank value, I am getting an error mesaage 'You have to enter variable values before you execute'.
    Any ideas?
    Regards,
    Srinivas Kamireddy.

  • Pass values through windows

    I have the next problem:
    I have a text box named "City" , and next to it I have a button, which open a new window where the user can search for a specific city. For expample, when the search window opens, the user can input %new%, and then the same page load new york, new yersey, etc, so the user pick one, and accept.
    So the city that the user chose, have to be passed somehow to the first page. How can I do this, pass the value to the first page? that is how can I pass the city "new york" for example, from the search window to the first window?
    Thanks a lot.

    You have two options:
    1) use javascript to set a form field (recommended)
    2) use the session
    a popup window has the same session as the opener. As for javascript, you can use something like:
    window.opener.formname.fieldname.value = document.formname.city.value;to set the field 'fieldname' in the parent page.

  • Trying to set application item value through javascript

    Hi,
    I am not sure what I am doing wrong here can someone possibly shed some light? I have the following in my
    HTML Header of my login page
    <script language="JavaScript1.1" type="text/javascript">
    function setAppItem(val){
      var req = new htmldb_Get(null, &APP_ID., 'APPLICATION_PROCESS=dummy', 
      &APP_PAGE_ID.);
      req.add('F_LOGIN_MESSAGE', val);
      var gReturn = req.get();
      req = null;
    </script>
    <script language="JavaScript1.1" type="text/javascript">
    function doLogin()
      var err = false;
      alert(document.getElementById('P101_USERNAME').value);
      if((document.getElementById('P101_USERNAME').value == '') ||
        (document.getElementById('P101_PASSWORD').value == '')) {
        setAppItem('You must enter a username and password.');
        err = true;
      if(!err) {
        doSubmit('Login');
    </script>The setAppItem function does get called but it is not setting the application items text?
    Thanks in advance for any help!

    Thanks for all of your help Jari it is appreciated!
    For others the solution was to add the following to my HTML Source
    <div id="LOGIN_MESSAGE"></div>and then created the javascript routine
    <script language="JavaScript1.1" type="text/javascript">
    function setAppItem(val)
      $x('LOGIN_MESSAGE').innerHTML=val;
    function doLogin()
      var err = false;
      if($v('P101_USERNAME') == '' || $v('P101_PASSWORD') == '')
        setAppItem('You must enter a username and password.');
        err = true;
      if(!err)
        doSubmit('Login');
    </script>
    Thanks

  • Passing values through RFC

    Hi All,
    I have a requirement where we need to connect to a different system using RFC and pass data.
    I have data in the table . The requirement is using RFC, i have to write a code, so that i can send all the possible values of a field in the table to the remote system. I have 5 fields in my table in SAP. First i need to pass all the possible values of field1 to the remote system and based on the input in their system, i need to pass all possible values for field2 to remote system and again based on field1 and field2 i need to pass all possible values for field3 to remote system.
    Pls let me know how to do coding for this.
    Thanks,
    Raju

    Raj,
    We need to pass the possible values from our custom table to the remote system, so that the user can see all the possible values for the fields. Similar to the F4 option.
    And based on field1 input in the form by the user, we need to get corresponding values for field2 of all possible values and pass it to the remote system.
    If your user is filling the forms in the non-SAP system itself, means you are just providing the data to that system for the actual user action there. So, either you can send the whole data everytime and let non-sap system handle the logic which you need for the possible values for each selection. Better if you are able to store all data in the remote system itself to avoid large data communication everytime and just sync the 2 systems whenever something changes in SAP.
    Otherwise, if you want to control it from SAP itself, then you need 2 way communication.....once user fills 1st field in FORM, remote system sends that to SAP and then you send the 2nd field valid values to remote system again using same/different RFC and so on. But, I doubt that will be efficient for the user filling the form.
    Regards,
    Diwakar

  • How to get values through JavaScript

    Hi,
    I have a report region, in this report one column is Select List having values 1,2,3,4,5 & other columns are text fields.
    I want if user selects 1 from select list then next column of report should get disabled.
    Any help would be really appritiated.
    Thanks,

    onchange="javascript:setvalues(this,'here your text filed name')";Note: text field name like f01..
    put the above code in report column attributes -->
    select list column--> Tabular form Element --> element attributes
    Then
    <script type="text/javascript">
    function setvalues(filter,textboxname)
    var s = filter.id; ----> this is for your report id taken
    var item = s.substring(3,8); --> common id
    var field3 = textboxname + item; ---> now it will give your text box name its look like f05_0001
    alert(filed3);
    var a = filter.value; ----> it will give your select list value.
    alert(a);
    }take the alert message values.
    put the code in page attributes --> HTML Header.
    check this first ...
    send your text box id. it will look like ex: f05_0001
    Cheers,
    Shan

Maybe you are looking for

  • My box tried to upgrade and now it gives me a blac...

    Hi, I'm carrying this over from another message as it was in the wrong place and deserves it's own thread. So far the conversation runs ... ME : I was sat watching late on Friday night (around 1:00am Saturday morning actually) when my box decided an

  • Error in MAIL notifications in AIA PIP 11g Status Code DELIVERY_TO_GATEWAY

    Hi, I am getting the following error while sending the mail notifications : Operation     Send Overall Status     Failed Status Code     DELIVERY_TO_GATEWAY_FAILURE Status Message     javax.mail.AuthenticationFailedException Timestamp     Sep 1, 2011

  • Final Cut Pro 6 by Diana Weynard: Format too New FOR THIS VERSION OF APP?

    I purchased the book book Final Cut Pro 6 by Diana Weynard and it is a basics book overview of FCP However it comes with CD and I have downloaded the CD to my hard drive and when i open the files in FINAL CUT PRO 6 it says: FILES FORMAT IS TOO NEW FO

  • HT4061 my computer unable to connect itunes server

    my computer unable to connect itunes server,even itune help is also not connect to server the massage will be "iTunes Help is unavailable because your computer isn't connected to the Internet.

  • Getting songs from one computer to another

    I bought an album a few weeks ago (first time) and I just bought a new laptop. How can I get these files from my old computer to my new one? I thought if I make the new computer authorized, I would have access to these files, but cannot. Please help.