Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Populating fields on a webpage based on the remote webpage data

 
dinesh lokesh
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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.
 
Harmanjit Singh
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • 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
  • 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"
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic