Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

About frames in jsp

 
Ashutosh Arya
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a scenario in which I am having two frames in one parent page.I want to use the javascripts used in the page included via frame in the main parent page so that if I use the javascript function in the child page it effects the whole parent page.

Right now the js is effecting only the child page(included via frame).

I have tried including the js function in the parent page but in that case the function is not working as the call to the function is inside the child page.

Please help me out regarding this.

Aashu.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This should probably be in HTML/JavaScript.

I think you'd have to explicitly call the parent's JS function (parent.blah() or something like that, I don't recall).
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please take the time to choose the correct forum for your posts. This forum is for questions on JSP. For more information, please read this.

This post has been moved to a more appropriate forum.

 
Ashutosh Arya
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bear,I will keep that in mind from next time.

Please elaborate the solution if you can.

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The child frames can reference the parent via parent.
 
Ashutosh Arya
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the solution Bear but if I explicitly call the function from parent window the effect of the function is limited to child window only as the call to the function is in child window.

I want the effect of the javascript function (actually being used to open a dhtml window) to be shown over parent(i.e.,the dhtml window should superimpose parent frame).

A little explanation:

I am having two frames in a jsp.Each frame is used to show a separate jsp.
Now the top frame is containing some header jsp and some javascript function which is used to open a dhtml window when we click on a relevant link.

The problem is that this new window is being superImposed by the bottom frame thus hiding the dhtml window.I want that the dhtml window superimpose both the frames.

I hope now you can help me out.

Aashu.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It can not happen, the two frames are "seperate" windows, hence why you really should not use frames in applications theses days.

Eri
 
Ashutosh Arya
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Eric..

Now In place of using frame I am trying to include that page inside <td> tags.But still I am not able to include a servlet which is responsible for output of one frame?

How can I include a servlet using jsp include tag?

Or please suggest any other better approach for the scenario.

Thanks again.

Aashu
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ashutosh Arya wrote:How can I include a servlet using jsp include tag?

Using the JSP include action (not the directive) simply reference the URL of the servlet.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic