• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Passing Array to Popwindows

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,
Can we pass an Array object to popup window ?
This is what I am trying to Intend:
--> I am createing an Array object in the Mainwindow and filling it up with certain values
--> On main window button click , I will pop up a window in which i want to pass this array .
Purpose is simple : User has to select one value out of all values in this Array. So I will have to display array elements in popwindow and user will pick one.
--> On popwindow button click , the value selected by user will get filled up in mainwindow text.

==> I am aware of passing Element values from main and popvaule ( back and forth) , but am not sure how to pass an Array from main to popup.
Please let me know ...
thanks in advance.
Stag
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you can reference any JavaScript variable from the parent with the child by:
var childValue = window.opener.VariableName;
is that what you are asking??
Eric
 
stago pat
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Erik -
thanks for prompt reply..
but thats not what I am looking for :
mainpage:
SCRIPT LANGUAGE="JavaScript"><!--
myPopup = '';
var mainArray = new Array();
mainArray[0] = "a";
mainArray[1] = "b";
..
}
popuppage:
--> I want to retrive values from mainArray on mainpage.html and Assign it to Local array(popupArray) on poppage.
==> I want to use Javascript for the same.
Thanks
Stag

//--></SCRIPT>
 
stago pat
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hey Eric -
Sorry about previous note :
The Answer you gave on the first shot is working as intended.. it took me little long to understand it ..
but.. Yupe your solution works for me...
bunch of thanks
 
reply
    Bookmark Topic Watch Topic
  • New Topic