Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to wait till a form is loaded

Status
Not open for further replies.

hemajb

Programmer
Sep 26, 2003
19
IN
I have 2 files, one is a html file and another is a jsp file. html file has a method "funcA" which calls a method "funcB" in a jsp file. "funcB" submits the form in the jsp and reloads the jsp page.
How do i make "funcA" to wait till the jsp is reloaded. Please reply me if anyone knows an answer to this..Its "QUIET URGENT"

Thanks in advance..
Hema
 
Load the JSP file first. in the JSP file call a function that will open the HTML file. i guess u r using frames (r u?). do u get the concept?

Known is handfull, Unknown is worldfull
 
Yes i am using frames.I have a frameset (in Main.html) which holds these 2 files (api.html and Locale.jsp) in the frames (api and Locale respectively) . I have a <input> of type button kept in api.html that calls &quot;funcA&quot;. This &quot;funcA&quot; internally calls &quot;funcB&quot; which submits Locale.jsp . In the onload() method of Locale.jsp i have a value &quot;ValA&quot; that is set .I want to access this value in &quot;funcA&quot; , thats the reason i want the &quot;funcA&quot; to wait till Locale.jsp gets loaded.


funcA() //in api.html
{
top.frames['Locale'].funcB();
alert (top.frames['Locale'].valA); //its alerting empty string :(

}
//script in Locale.jsp
<script language=&quot;javascript&quot; >
var valA=&quot;&quot;;
funcB() //in Locale.jsp
{
frmLocale.submit();
}

onLoadLocale() //this is called onload of Locale.jsp
{
valA=&quot;<%=session.getAttribute(&quot;Name&quot;)%>&quot;;
}

</script>

I hope u got what am trying to do..

 
ur frameset must be something like this (pretty bare):
Code:
<frameset rows=&quot;10%,*&quot;>
<frame src=&quot;Main.html&quot; name=&quot;topframe&quot;>
<frame src=&quot;locale.jsp&quot; name=&quot;Locale&quot;>
</frameset>

now change it to:
create a file blank.html with no content at all.
ur frameset must be something like this:
Code:
<frameset rows=&quot;10%,*&quot;>
<frame src=&quot;blank.html&quot; name=&quot;topframe&quot;>
<frame src=&quot;locale.jsp&quot; name=&quot;Locale&quot;>
</frameset>


noe in locale.jsp
Code:
<script language=&quot;javascript&quot; >
var valA=&quot;&quot;;
funcB() //in Locale.jsp
{
 frmLocale.submit();
}

onLoadLocale() //this is called onload of Locale.jsp
{
valA=&quot;<%=session.getAttribute(&quot;Name&quot;)%>&quot;;
 parent.topframe.location.href='api.html'
}

</script>


do u get the idea?

Known is handfull, Unknown is worldfull
 
I shall try this and get back to u if this doesnt work..
Thanks
 
I got what u were trying to convey, but the problem here is i have the function in api.html calling a function in locale.jsp which takes care of submitting the locale.jsp , i want that function in api.html to wait till this locale.jsp is RELOADED.
 
but ur API page wont even load before ur jsp file. i dont get it...

Known is handfull, Unknown is worldfull
 
ok..

I have main.html which hold 2 frames &quot;locale&quot; and &quot;api&quot; frame . api frame has api.html and locale frame has locale.jsp . i dont bother the very first time these 2 pages are loaded.

I am displaying a textbox and button in api.html.onclick of this button i call &quot;funcA&quot; which is in api.html which inturn calls &quot;funcB&quot; in locale.jsp.This function &quot;funB&quot; actually submits locale.jsp and reloads the jsp.. Now i want this &quot;funcA&quot; to wait till locale.jsp is reloaded..

i guess i made it clear this time,did i??



 
a better way is to write the code of funcA that must be called by locale.jsp in locale.jsp itself...

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top