I assume your example is a simplistic representation of a more complex
problem that requires some JSP processing, not simply showing "button go
pressed". If not, the JavaScript method is the most efficient way to do it.
Assuming you want to do some processing that requires JSP and show the
results on the bottom frame, however, the way I would probably accomplish
this is by posting your action from the top frame to the bottom frame URL.
You can do this in at least 3 ways:
1. If you use the <FORM> tag in top frame, set the TARGET parameter to the
bottom frame as follows: <form action="foo.jsp" target="myBottom"> ...
</form>
2. If you use <A HREF> tags for your buttons in top frame, set the TARGET
parameter to the bottom frame (passing the clicked button in the query
string) as follows:
<a href="foo.jsp?btn=[clickedbuttontext]"
target="myBottom"><img="yourButton1.gif"></a>
3. If you want to use a JavaScript method, change the .URL or .location
property of the bottom frame using JavaScript and the DOM as:
<SCRIPT>parent.myBottom.document.URL =
"foo.jsp?btn=[clickedbuttontext]";</SCRIPT>
Hope that helps some
Jorge Barrera
Coral Reef Technologies, Inc.
-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Maria Baldassarri
Sent: Tuesday, August 29, 2000 11:01 AM
To: [EMAIL PROTECTED]
Subject: jsp , buttons and frame
I have a page with 2 frames whose names are "top" and "bottom".
The top frame contain some input form and some buttons
The bottom frame should contain the output of some processing that occur on
the server.
I would like to relize this scenario using jsp.
As first step I would like to write on the bottom frame which button of the
top frame has been pressed
I've written some code in the top.jsp like the following
<br>The following button has been pressed:<br>
<%
if(request.getParameter("reload.x")!=null){
out.println ("reload");
}
if(request.getParameter("start.x")!=null){
out.println ("start");
}
if(request.getParameter("stop.x")!=null){
out.println ("stop");
}
if(request.getParameter("go.x")!=null){
out.println ("go");
}
%>
This code shows which button has been pressed on the top frame
what do I have to write to show the same info on the button frame?
I've tried to write some static text in the bottom frame with the following
code at the end of my top.jsp file, but with no success:
<SCRIPT language="JavaScript">
parent.bottom.document.write("<HTML><HEAD><TITLE>Test</TITLE></HEAD><BODY>")
;
parent.bottom.document.write("writing on bottom frame");
parent.bottom.document.write("</BODY></HTML>");
</SCRIPT>
If this code would work, I could combine the two above, and solve my
problem!!
what am I missing?
thanks a lot Maria Baldassarri
*************************************************************
Maria Baldassarri
Performance Area Development
Rome Tivoli Laboratory
Via Sciangai, 53
00144 - Rome (Italy)
Tel.: +39 (06) 59662701
E-Mail: [EMAIL PROTECTED]
Fax: +39 (06) 59662456
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets