javascript thread: How do I show a "wait" message after submitting a form and waiting for the response
Let us get this scenario Clear,
You have a JSP Page which creates HTML output. This HTML output has two
frames. One of these frames (hiddenFrame) has a JavaScript function
(doSomething()).
Now when you submit the page to a Servlet, you write out <Script language
JavaScript>doSomething();</Script>
And you expects doSomeThing to execute.
Now I am assuming that your display.html was submitted to invoke your
servlet. In that case the results of the submission will by default come
to
the FRAMESET where display.html was sitting. In that case you can still
access the Java Script Fn in Hidden.html by the following notation.
document.parent.hiddenFrame.doSomething();
When you use hidden Frames to continuously hold JavaScript functions and
variables, It is a good practice to use the TARGET property of Form submit
to pinpoint the FRAMESET to which submission should happen.
thank you
bONI
----- Original Message -----
> > From: "Rich" <ejbquestions@y...>
> > To: "javascript" <javascript@p...>
> > Sent: Wednesday, December 26, 2001 10:57 PM
> > Subject: [javascript] RE: How do I show a "wait" message after
submitting
> a
> > form and waiting for the response
> >
> >
> > > ---
> > > Need a present for your favorite programmer?
> > > E-Documents from Amazon.com at http://p2p.wrox.com/edocs.asp
> > > ---
> > > Hi,
> > > How do I call a client script function from a
> > > servlet running on the server. Please see e.g below
> > > where the display.html has a function called
> > > "DoSomething()".
> > >
> > > I have .jsp which opens a window. This window has 2
> > > frames. One of the frame is hidden.
> > >
> > > In Main .jsp:
> > > testw = window.open('/openFrame.html');
> > >
> > > In openFrame.html:
> > >
> > > <html>
> > > </head>
> > > <FRAMESET BORDER=0 COLS="100%,*">
> > >
> > > <FRAME SRC="display.html" NAME="displayFrame"
> > > BORDER=0 SCROLLING=no>
> > >
> > > <FRAME SRC="hidden.html" NAME="hiddenFrame" BORDER=0
> > > SCROLLING=no>
> > > </FRAMESET>
> > > </html>
> > >
> > > In display.html:
> > > <html>
> > > <script>
> > > function doSomething() {
> > > }
> > > </script>
> > >
> > > <Body>
> > > </body>
> > > </html>
> > >
> > >
> > > In the Servlet, I have the following code:
> > >
> > > public void doPost(HttpServletRequest request,
> > > HttpServletResponse response) throws ServletException,
> > > IOException {
> > >
> > > OutputStream out = response.getOutputStream();
> > > out.write("<script>doSomething();</script>".getBytes();
> > > out.flush();
> > > }
> > >
> > > The above doesn't seem to work. Any idea?
> > >
> > > Thanks,
> > >
> > >
> > >
> > > --- Oleg Kapeljushnik <c-oleg.kapeljushnik@w...>
> > > wrote:
> > > > I am using ASP and what I am doing is next:
> > > > While I am proccessing something in the loop
> > > > every step I do I send some JavaScript code to the
> > > > browser
> > > > that increasy counter in my proccess bar .
> > > > I can send you some code but its in the office..:(..
> > > > so it can be only after weekend.
> > > > You can check some ASP website for an example.
> > > > I found it there.
> > > >
> > > > Oleg
> > > >
> > > >
> > > > -----Original Message-----
> > > > From: Rich [mailto:ejbquestions@y...]
> > > > Sent: Saturday, December 15, 2001 3:55 PM
> > > > To: javascript
> > > > Subject: [javascript] RE: How do I show a "wait"
> > > > message after submitting a
> > > > form and waiting for the response
> > > >
> > > >
> > > > Actually the process is running on the application
> > > > server. (Session EJB). The browser client (a .jsp)
> > > > sends request to another .jsp called the controller
> > > > (running on the webserver). The controller then
> > > > calls
> > > > an EJB method in which the long process is taking
> > > > place.
> > > >
> > > >
> > > > --- Oleg Kapeljushnik <c-oleg.kapeljushnik@w...>
> > > > wrote:
> > > > > Is this proccess that running on the server server
> > > > > side script or
> > > > > can some server side script communicate with this
> > > > > process ?
> > > > >
> > > > > Oleg
> > > > >
> > > > > -----Original Message-----
> > > > > From: Roshan [mailto:ejbquestions@y...]
> > > > > Sent: Saturday, December 15, 2001 3:06 PM
> > > > > To: javascript
> > > > > Subject: [javascript] How do I show a "wait"
> > > > message
> > > > > after submitting a
> > > > > form and waiting for the response
> > > > >
> > > > >
> > > > > Hi,
> > > > > I have a long process running on the server.
> > > > When
> > > > > the form is submitted
> > > > > which triggers the process on the server, I want
> > > > to
> > > > > show a wait message
> > > > > or progress. I can get the percentage progress
> > > > from
> > > > > the server. But how do
> > > > > I show a progress bar and keep updating it while
> > > > the
> > > > > processing is going
> > > > > on the server. When the browser kicks off the
> > > > > process, I can use a hidden
> > > > > frame to send request to the server and get the
> > > > > percentage information.
> > > > > My questions is how do I sent both the request
> > > > > simultaneously. i.e 1.
> > > > > Submitting the form and sending a request to get
> > > > the
> > > > > percentage
> > > > > information and update the display. Code sample
> > > > > would be helpful.
> > > > >
> > > > > Thanks,
> > > > > Rich
> > > > >
> > > > >
> > > > > $subst('Email.Unsub').
> > > > >
> > > > $subst('Email.Unsub').
> > > >
> > > >
> > > > __________________________________________________
> > > > Do You Yahoo!?
> > > > Check out Yahoo! Shopping and Yahoo! Auctions for
> > > > all of
> > > > your unique holiday gifts! Buy at
> > > > http://shopping.yahoo.com
> > > > or bid at http://auctions.yahoo.com
> > > >
> > > > $subst('Email.Unsub').
> > > >
> > > >
> > > $subst('Email.Unsub').
> > >
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Send your FREE holiday greetings online!
> > > http://greetings.yahoo.com
> > >
> > $subst('Email.Unsub').
> >
>