Hi !
I have a main JSP page with multiple frames (each one is a JSP page). In one frame (frame 1),I have a button called "Add child". In another frame (frame 2) has all parents with radio button for each of it. On select a prent and clicking the add child button, a new window pops up with some form fields (select box). The user selects from the list and clicks "add" button. In this the jsp calls a business method in a bean and finally updates the table and then reloads the second frame (frame 2, which has all parents), so the added child is also seen below the parent. But as of now, the child gets added in the table but the page does not show the child, (which means the page is getting reloaded before the table is getting added.
Here is the code :
-----------------------------------------
<%
try
{
Context ctx = getInitialContext();
PartManagerHome pmh = (PartManagerHome) ctx.lookup("PartManager");
PartManager pm = pmh.create();

if(request.getParameter("hdAddFac") != null && request.getParameter("hdAddFac").equals("Y"))
{
    int index = request.getParameter("lstSuppFac").indexOf("/");
    String nfac = request.getParameter("lstSuppFac").substring(0, index-1);
    String nsupplier = request.getParameter("lstSuppFac").substring(index+2);
    String m_array[] = {"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"};
    Date date = new java.util.Date();
    java.sql.Date sqldate = new java.sql.Date(date.getYear(), date.getMonth(), date.getDate());
    String sdate = sqldate.toString();
     
    PartSupplier p_supp = new PartSupplier(request.getParameter("hdFac"), nsupplier, nfac, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, String.valueOf(session.getValue("userid")), sdate);

    pm.addNewSupplierfac(request.getParameter("hdFac"), p_supp);
}
%>
<SCRIPT LANGUAGE="Javascript1.2">
var sleepcount = 0;
while(sleepcount < 100)
{
    sleepcount++;
}
opener.parent.frames[4].location.reload();
opener.parent.frames[1].location.reload();
window.close();
</SCRIPT>
-----------------------------------------------------
The while loop is to make the reloading after sometime.
How to rectify the problem.
Thanks
AJP