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..."

Similar Messages

  • 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)

  • Re: Help needed in passing values from workflow to Approve Forms

    Dear Experts,
    how do I pass values from a workflow to a step (Form) - approve form?
    I am using a customized table structure as my data source (FORMCONTAINERELEMENT) but am stuck on how to access the data when i get to to the screen painter's flow logic... What am i missing? Can you give me a step by step example. the ones i see on the net are input fields that update the screen... nothing that shows value being passed from the outside.
    I need to pass an exisitng value in the workflow into the form for approval of the the assigned agent.
    Please help!!
    Thank you.

    Hello !
             Create a method just before the form step.This method should populate the values for the fields maintained in the form.
             Pass the values populated from this method to your customized table structure (data source).In other words, you have to pass all the values to the workflow container.
            To the step, pass this workflow container by binding.In the control tab of form step, you have to do the binding.
    Regards,
    S.Suresh

  • How to pass values from main window to pop-up window?

    I want to pass a value from the main window (1st form) to pop-up window (2nd form). The first form is of name booking.jsp and 2nd form is of name Fund_booking.jsp. I am using window.showModalDialog to open the window. I think, I have written right code in main window to pass the value but even then I am not able to get it on pop-up window. I am not even able to display an alert on pop-up window saying "hi" by writing a function on save Button in pop-up window. The code is as follows:
    On booking.jsp:
    <script>
    function popup()
    var aForm;
    aForm = D_requisition_id.options[D_requisition_id.selectedIndex].text;
    \\Here I have captured value from a drop down box in my main window form and assigned it to the variable.
    alert(aForm);
    var myObject =new Object();
    myObject.Brandcode = aForm;
    alert(myObject.Brandcode);
    window.showModalDialog("Fund_booking.jsp",myObject,"dialogHeight:400px;dialogWidth:420px;");
    </script>
    <button name="B_FundBooking" tabIndex=4 style='POSITION:absolute;LEFT:393;TOP:292;WIDTH:100;height:24;BACKGROUND-COLOR:buttonface' onClick ="popup()">Fund Booking</button>
    On Fund_booking.jsp:
    <SCRIPT>
    var oMyObject = window.dialogArguments;
    var sBrandcode = oMyObject.Brandcode;
    alert(sBrandcode);
    </SCRIPT>
    Even the following alert is not getting displayed in pop-up window;
    <script>
    function ValidateData()
    alert("Hi");
    </script>
    <button name="B_Save" tabIndex=1 style='POSITION:absolute;LEFT:255;TOP:315;WIDTH:75;height:24;BACKGROUND-COLOR:buttonface' onClick ="ValidateData()">Save</button>
    I am using DIV instead of frames in my both forms. I just want to get that value in my pop-up window to write a query based on which data will get displayed in my table of pop-up window.
    Plz help me to solve this problem.

    Well, this is actually a JavaScript question, not a Java question but I can give some hints.
    When you do pop-up windows you need to put JavaScript in the html of the pop-up itself. Data can be passed by creating new fields in the window object, which the popup can access via the window.openner field.
    So, before invoking the popup add any data to be passed to the window object, then the onLoad function in the popup grabs the data.

  • How to pass value from main window to pop up window?

    I want to pass a value from the main window (1st form) to pop-up window (2nd form). The first form is of name booking.jsp and 2nd form is of name Fund_booking.jsp. I am using window.showModalDialog to open the window. I think, I have written right code in main window to pass the value but even then I am not able to get it on pop-up window. I am not even able to display an alert on pop-up window saying "hi" by writing a function on save Button in pop-up window. The code is as follows:
    On booking.jsp:
    <script>
    function popup()
    var aForm;
    aForm = D_requisition_id.options[D_requisition_id.selectedIndex].text;
    \\Here I have captured value from a drop down box in my main window form and assigned it to the variable.
    alert(aForm);
    var myObject =new Object();
    myObject.Brandcode = aForm;
    alert(myObject.Brandcode);
    window.showModalDialog("Fund_booking.jsp",myObject,"dialogHeight:400px;dialogWidth:420px;");
    </script>
    <button name="B_FundBooking" tabIndex=4 style='POSITION:absolute;LEFT:393;TOP:292;WIDTH:100;height:24;BACKGROUND-COLOR:buttonface' onClick ="popup()">Fund Booking</button>
    On Fund_booking.jsp:
    <SCRIPT>
    var oMyObject = window.dialogArguments;
    var sBrandcode = oMyObject.Brandcode;
    alert(sBrandcode);
    </SCRIPT>
    Even the following alert is not getting displayed in pop-up window;
    <script>
    function ValidateData()
    alert("Hi");
    </script>
    <button name="B_Save" tabIndex=1 style='POSITION:absolute;LEFT:255;TOP:315;WIDTH:75;height:24;BACKGROUND-COLOR:buttonface' onClick ="ValidateData()">Save</button>
    I am using DIV instead of frames in my both forms. I just want to get that value in my pop-up window to write a query based on which data will get displayed in my table of pop-up window.
    Plz help me to solve this problem.

    just attach the value with its url for example
    String names="java";
    <a href="# onclick="window.open('file.jsp?name='+names);"></a>

  • Passing value from dynamic page to form.....

    I have a portal page that has a dynamic page where I've created an html form. Also on this same page in different regions are three other forms which were created by the form wizard. From the dynamic page form I want to pass a session value to the other forms on the same page. Is this possible? I know it's possible from form to form using session apis. I've search the forum and have not found what I'm looking for. Can anyone be of any help on this topic?

    Melissa,
    It seems we have the same type issue.
    Session variable how to's are what I need also.
    There is a site with more information on it...a continuation of the Portal Handbook by Vandivier and Cox at home.covad.net/~idbexperts called an "Unpublished Case Study" - I don't know if it'll hit your needs on the head, but it may help to see it.
    I believe I am trying to hold session variables over til users complete a 4 part form across several pages (may be a space problem we have). Do you know how I start this?
    I don't know how to put p_session variables together, when or where the parameters are necessary and whether a procedure is necessary or not!!!
    If you would like to correspond offline, I am at [email protected] and would appreciate your insights.
    Mary

  • 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

  • Passing value from Frame Driver to Form

    Hi,
    I have a frame driver which shows some (project Names) when submitted calls a form in the target area. I'am joining 2-3 tables and i cannot pass the Rowid but i'am passing another field value. My problem is when i select a Project Name and hit the submit button , unless i hit the query button it does the value on the form . It works good when i pass the rowid (some other form). Does anyone know how to make this work?
    Thank You.

    Hi,
    Here is an example which calls the employee form. After clicking on the submit in the driving frame after selecting the employee, the employee form shows up with that particular employee's details.
    sample....
    select ename,'SJAYARAM903_1B.wwa_app_module.link?p_arg_names=_moduleid&p_arg_values=1060253649&p_arg_names=_sessionid&p_arg_values=&p_arg_names=_empno_cond&p_arg_values==&p_arg_names=show_header&p_arg_values=YES&p_arg_names=EMPNO&p_arg_values='||empno url from SJAYARAM903_1B_DEMO.EMP
    Thanks,
    Sharmila

  • Passing value from one view to form

    Hi Friends,
    This may be easy for you. I did 2-3 times but some how I am stuck this time.
    I am accepting user ID from one form and geting user information. I am trying to modify some information and then printing it in second form. SOme how value is not passing to my second for. While debugging I can see that value is there.
    For first name printing I am using
    $(global.firstname)
    But getting null as output.
    Please help me
    Thx

    Can u post your form ?? I need to see an example quite like yours.
    Thanks ,
    Victor

  • Passing value from Report Column to Javascript

    Dear Apex wizards,
    I am a bit stuck right now with implementing a modal pop-up/iframe/javascript and this forum is my last hope to fix this issue.
    Anyway, will try to explain what I am trying to accomplish.
    What I need is: I want to have an SQL report, as a very first column I want to have an "ID" numbers from my table and I want this column to have a "Column Link" set in "Column Attributes" proper ties. The trick is, that when I click on the column link (when I run my report on Apex page) I need a JQuery modal window to pop-up where in IFrame will be another page and this page will use an "ID" from my column link URL to display data. So, basically I want to pass an "ID" value from my parent page to my child page which is displayed in iFrame of modal window.
    And here is what I have:
    1. I do have an SQL report:
    select SUBNET_ID,
           long2ip(NETWORK_ADDRESS),
           long2ip(SUBNET_MASK),
           long2ip(END_HOST),
           long2ip(START_HOST),
           MAX_HOSTS,
           long2ip(BROADCAST_IP),
           NETWORK_CLASS,
           NETWORK_SIZE,
           HOST_SIZE
    from   YC_CM_IP_SUBNETS 2. Then, in "Column Attributes" for "SUBNET_ID" a have set a "Column Link" to URL as : javascript:ViewNetworkDetails(#SUBNET_ID#); 3. Now, when I run my page and point my mice on any item in my "SUBNET_ID" column I can see that it is getting a "SUBNET_ID" number from my table and it shows it in the buttom of the browser as :javascript:ViewNetworkDetails(1);, or (2) or whatever "SUBNET_ID" is. So, that is good.
    4. And here I am getting confused, basically I have to pass a value of javascript:ViewNetworkDetails(#SUBNET_ID#);, which seems to work as it gives me correct numbers from my table, to my "ViewNetworkDetails" JavaScript function, so it can paste this value into "f?p=........." iFrame URL. Below is my Jquery Modal form script and Javascript to redirect me to my popup page (the script is in HTML Header):
    <script type="text/javascript">
    function ViewNetworkDetails(){
    var apexSession = $v('pInstance');
    var apexAppId = $v('pFlowId');
    var subnetIDNumber = document.getElementById(#SUBNET_ID#);
    $(function(){
    vRuleBox = '<div id="ViewNetworkDetailsBox" title="View Subnet Details">
    <iframe src="f?p='+apexAppId+':103:'+apexSession+'::NO:103:P103_SUBNET_ID:'+subnetIDNumber+'
    "width="875" height="500" title="View Subnet Details" frameborder="no"></iframe></div>'
    $(document.body).append(vRuleBox);
    $("#ViewNetworkDetailsBox").dialog({
                            buttons:{"Cancel":function(){$(this).dialog("close");}},
                            stack: true,
    modal: true,                            
                            width: 950,                    
    resizable: true,
    autoResize: true,
    draggable: true,
    close : function(){$("#ViewNetworkDetailsBox").remove();
                            location.reload(true); }
    </script> P.S. My assumption is, that there is a problem with this part of my scriptvar subnetIDNumber = document.getElementById(#SUBNET_ID#); where I cannot get my "SUBNET_ID" value from javascript:ViewNetworkDetails(#SUBNET_ID#); into "subnetIDNumber" variable and that is why I cannot pass it to my iFrame URL.
    P.S. P.S. the child page 103 has a "Automated Row Fetch", so it is not a problem. In addition, I did a simple test, where I had a page item "P102_Value" with some value and in my script I had instead var subnetIDNumber = document.getElementById(#SUBNET_ID#); this var subnetIDNumber = $v('P102_Value'); and it worked perfectly fine....but cannot make it working against SQL Select statement :-(
    HEEEEEEEEEEEEEELLLLLPPPP.
    Thanks

    Change your column link to send the subnet_id column's value to the function call (you mentioned it, but I m not sure if you actually did)
    javascript:ViewNetworkDetails(#SUBNET_ID#);<u>You are passing the parameter value to the function, but not defined any parameters in the function definition</u>(this is possible in JS, any extra parameters is ignored)
    So, modify the function to accept the subnet ID parameter(I am actually surprised how you missed this) and assign that parameter to variable.
    <script type="text/javascript">
    function ViewNetworkDetails(pSubnetId){
    var apexSession = $v('pInstance');
    var apexAppId = $v('pFlowId');
    var subnetIDNumber = pSubnetId;
    //rest of the code would be the same

  • Problem in Passing the value from child window to Parent window.

    Hi Frenz,
    I have a requirement like this. i have to pass a value from child window to parent window to one test field. That text field is not a normal text field.
    It was created like the following as SQL query.
    select
    ''LNo,
    apex_item.text(25,'',0,15,
    'style="width:100px;" onblur="javascript:showUpsell(this.value);" onkeypress="javascript:validateKeyPress(event,this.value,this.id);" onkeyup="javascript:this.value=this.value.toUpperCase();" id="P37_ITEMNO"') ItemNo
    Now i want to pass a value to the Item no from child window.
    i wrote the java script like this,
    opener.document.forms[0].f25.value="100";
    It was not working..Any suggestions for that..
    Thanks in advance

    Dear Baaju,
    How do you redirect your control from Child to Parent window.
    If you use a button to do this, then you can set this value in the branching of page.
    Rana

  • Passing values from a FORM to another FORM

    Hi,
    I have to pass values from FORM "A" to FORM "B". What is the best way to do this?\
    Can I use a GLOBAL variable?
    Thanks,
    Marc.

    I think he meant the global namespace.
    You set a :global_your_name_here to a value and that value is available in your entire application. See the help file section on the global namespace for more information.
    Forms parameters are parameters that you form picks up from the outside when it starts. The calling entity must supply them in the URL or they will be set to null. You set them up in the object navigator in the Parameters node.

  • Passing value from Webdynpro ABAP to Adobe form..

    Hi experts,
            In first view of web dynpro, im getting employee id as input and after clicking the create new button, an adobe form is called
    to create the employee details ( in form i used the submit button and i stored the details ). so, in tat form i used the employee id as read only mode and it has to display the value which i given as input. But in tat form im not getting the value from web dynpro..
    can anyone plz help me out for this..
    Thanks in advance..

    Hi,
    Try to set your values in Method->"wddomodify" of the View in which Adobe Form is present. If you want to pass values from one view to another then check this link [Passing Local Parameters between views in an ABAP Web Dynpro Application|http://wiki.sdn.sap.com/wiki/display/stage/PassingLocalParametersbetweenviewsinanABAPWebDynproApplication] or use Context declared in Component Controller.
    Regards
    Pradeep Goli

Maybe you are looking for

  • How to get  the last used session id for a browser session

    In HTMLDB 2.0 it is not possible to start a page with authentication without a SESSION_ID and when you start a public page without a SESSION_ID, then every time a new SESSION_ID is generated when you don't use the SESSION_ID in the URL. In the same b

  • Bridge Freezes when Show Items From Sub Folders

    Hi all. I am trying to create a portfolio of past works. Using Adobe Bridge and Show Items From Sub Folders makes it easy to go through thousands of files. One major problem though; Bridge is not stable. When I try to view a folder with thousands of

  • ITunes Producer warning

    What does this warning from iTunes Producer 2.9 mean? WARNING ITMS-9000: "Core_4_Worked_Examples.ibooks : assets/search/searchIndex.xml  : instance attribute 'satisfy' does not match term 'satisfi'  This error occurred 516 times." at Book (MZItmspBoo

  • Question about SAP Router Version

    Hi All, I have a question about SAP Rotuer. How can I check what is my sap router version? I plan to upgrade my sap router to version 23 because It can monitor by windows services. Does any one know about this ? Please kindly explain. Thank you & Reg

  • Arrear for a customer

    Hi Gurus,              My requirement is to find Average arrears  for a customer.Could any1  suggest me some right way to find average arrears. Thanks & Regards, ashok...