• 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

Populating fields on a webpage based on the remote webpage data

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I dont really know where to post it,
but I have on Struts application runnung on a server say server 1
and a Other Java/ .net based application on other server- server 2

I am opening the server 1 from server 2 with the credentials and a search parameter in a URL, and displaying the data on server 1 page,
server 2 page is still open with a blank form in a browser window,

now after displaying the data on server 1 , I want to populate server 2 form with data in a selected row data in server 1..

THanks in advance.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

One solution can be,
When row is selected on server 1 page, row data is copied to clipboard.

On server 2 page, have some button,which when clicked causing javascript to run that reads clipboard data, parse it and paste in into your form elements.

But be ready to get browser warning for potentially unsafe javascript code.

This would work for sure but don't know how users will react when they get browser warning for unsafe code. Also the code gets very complex for clipboard handling.


Other better way could be if parent / child relationship can be created between two pages and they can interact with each other directly. Some Javascript expert would be able to help you in this. (I will search for second solution. Lets see if I can find something.)
 
Harmanjit Singh
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Second solution can be,

using "window.open(url)" and "opener" property avaialble to child window.
opener - Contains a reference to the window that opened the secondary window via window.open().

Using opener property you can call parent windows javascript method. So when you select a row in child window you can pass its content to parent window using opener.<methodname>(<content to pass>)

Tested with simple html pages
Parent.html

And "Child.html"
 
Sasparilla and fresh horses for all my men! You will see to it, won't you tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic