How to add a frame dynamically in a jsp page.

Hai all,

In my application, in a particular jsp page i had the 3 links namely add.edit and delete. When click on add button, it is pointing to another jsp page where i can enter user details. But what i want now is when i click add button, the form in which we fill the user details should be added to the current page itself dynamically i.e., it should not go to another page when i click add button and that form should be displayed in the current page in a new frame dynamically.

The same should happen when i click n edit or delete options. everything should be diaplayed in the same page in different frames.

Can anyone suggest me about how to add a frame dynamically.

[701 byte] By [jayastrutsa] at [2007-10-3 4:52:56]
# 1

You create a frameset with two frames. One frame you give 100% of the rows and run the JSP in this frame. The other frame you give 0% of the row so that it is hidden. In the JSP you use a JavaScript funtion to submit the form. This function will call the parent frameset to reset the row values to 50%/50% which will make the bottom frame visible and then submit the form request with the bottom frame as teh target.

It is not so much as creating frames as using JavaScript to hide and display frames.

tolmanka at 2007-7-14 22:57:46 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

The way I would do it is using DIV tags instead of Frames.

put the html code for add & edit in seperate DIV tags and by default made them hide ( there is a property for DIV to make it hide )

when you need them( using what ever event ) just call a javascript function that changes the DIV property visible that makes the area ( code) inside div to appear

downside to this approach is that DIV will push the rest of the area on the page when it visible.

ynroya at 2007-7-14 22:57:46 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...