Frames and the Model 2 architecture

K

Klaas

Hi,

I am working on a Web app using the Model 2 architecture. The view
(index.jsp) consists of 2 frames, the left frame containing thumbnail pics,
the right one containing the selected pic. The frame content is included
using 2 jsp:include tags referring the controllerservlet.



index.jsp:

....

<FRAMESET frameborder=no cols="20%,80%">

<FRAME src="controllerservlet?cmd=thumbnailframe" NAME="LeftFrame"
scrolling=AUTO>

<FRAME src="controllerservlet?cmd=pictureframe" name="RightFrame"
scrolling=AUTO>

<NOFRAMES>

....



This works OK. The pictureset displayed in the left frame is obtained from
the Model and is selected using a dropdown menu in the left frame.

And there occurs my problem. When a new picture group is selected, the
controllerservlet updates the Model and dispatches the request to the
thumbnailframe. Then the updated thumbnailframe is displayed correctly but
the right frame still contains the old picture UNTIL a thumbnail picture is
clicked.

It is logic that this happens because the right frame is not updated
automatically. But how can I manage this ??? Dispatching the request to
index.jsp is no solution because then the complete index.jsp is showed in
the left frame !!!

In fact, I would like to do an invisible request to the controllerservlet
with the cmd set to pictureframe and the target set to "RightFrame", this is
exactly what happens when a thumbnail picture is clicked...

Anybody has a solution ???

TIA,

Klaas
 
C

Cedric ROCHEFOLLE

Klaas said:
And there occurs my problem. When a new picture group is selected, the
controllerservlet updates the Model and dispatches the request to the
thumbnailframe. Then the updated thumbnailframe is displayed correctly but
the right frame still contains the old picture UNTIL a thumbnail picture is
clicked.

It is logic that this happens because the right frame is not updated
automatically. But how can I manage this ??? Dispatching the request to
index.jsp is no solution because then the complete index.jsp is showed in
the left frame !!!

In fact, I would like to do an invisible request to the controllerservlet
with the cmd set to pictureframe and the target set to "RightFrame", this is
exactly what happens when a thumbnail picture is clicked...

Anybody has a solution ???


I think this concerns JavaScript. The frame that contains the picture needs
to be reloaded. For example, you could use a javascript command in the end
of the thumbnail frame to refresh or submit a form in the picture frame.

Cedric
 
T

Tor Iver Wilhelmsen

Klaas said:
It is logic that this happens because the right frame is not updated
automatically. But how can I manage this ??? Dispatching the request
to index.jsp is no solution because then the complete index.jsp is
showed in the left frame !!!

You need to send a full FRAMESET again with the right parameters for
the FRAMEs. use target="_parent" to replace it (the parent of the
frame you're in).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top