473,327 Members | 2,094 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Remember frame sizes for web application across reloads and frameset changes?

I have a web app which comprises different frames: a menu bar frame, a
search form frame, a result list frame. Depending on the state, only
a subset of these frames is available. (Eg, after login, only the
menu bar frame exists to allow the user to select a search form.
After this, only the menu bar and the search form are visible.)

Now the users are to be able to resize the frames.

WIBNI the webapp could remember the frame sizes across reloads and
frameset changes? For example, if the user resizes the menu bar frame
after login, then it should retain the width even after the user
chooses a search form, and after performing the search.

I have been able to remember the frame width in a cookie by using
JavaScript and onunload events. I have also been able to frob the
frameset definition on load, to replace the default frame widths with
the ones from the cookie. (Actually, the frameset definition is a
JSP, so I can access the cookie from there.)

But I was wondering if there is a generic approach so that I don't
have to write special code for each and every frame. Is there?

I'm also wondering if it is perhaps better to store the frame widths
in the HTTP session, rather than the cookies. (It would be easier to
access the frame widths from JSP in that case.) But it has proven
difficult to store the frame widths in the session from JavaScript, so
I abandoned that approach.

Suggestions appreciated.

Kai
Kai
Jul 20 '05 #1
13 2695
Kai Grossjohann wrote:

Now the users are to be able to resize the frames.

WIBNI the webapp could remember the frame sizes across reloads and
frameset changes? For example, if the user resizes the menu bar frame
after login, then it should retain the width even after the user
chooses a search form, and after performing the search.


Why make it so complicated in the first place? Why use JavaScript,
Frames, Cookies? Can you point us to your page so we can see how it
must be frames?
Jul 20 '05 #2
"Philipp Lenssen" <in**@outer-court.com> wrote in message news:<bp*************@ID-203055.news.uni-berlin.de>...

Why make it so complicated in the first place? Why use JavaScript,
Frames, Cookies? Can you point us to your page so we can see how it
must be frames?


No, I can't point you to the page. I can't make pages available from
behind the company firewall.

It does not *have* to be frames, but the alternatives are even worse.
The objective is to make it look like the corresponding windows
application. The windows app looks like this (ascii art):

+----+------+-------+
| | | |
| 1 | 2 | 3 |
| | | |
+----+------+-------+

The left pane (labeled 1 in the above figure) contains a list of query
form names. Clicking on one of them shows the query form in the
middle pane (2). Entering data and submitting the form shows the
result list in the right hand pane (3). Each pane is separately
scrollable if the contents are too large.

The user is to be able to drag the vertical line between 1 and 2 with
the mouse to resize panes 1 and 2, and also the vertical line between
2 and 3 to resize panes 2 and 3.

If 1, 2, 3 are three frames, then I get the draggability of the two
lines for free.

I also tried to use a drag-and-drop JavaScript library to draw
vertical lines which are draggable. In that variant, each pane is
represented by a div (with scrollbars, if necessary), and dragging the
vertical lines uses JavaScript to frob the DOM such that the div
widths are adjusted properly. (Actually, I used a table with one row,
and each cell contains one div.) It's really painful to get it right.
And the library appears to fail in IE5.0.

Kai
Jul 20 '05 #3
Kai Grossjohann wrote:

I also tried to use a drag-and-drop JavaScript library to draw
vertical lines which are draggable. In that variant, each pane is
represented by a div (with scrollbars, if necessary), and dragging the
vertical lines uses JavaScript to frob the DOM such that the div
widths are adjusted properly. (Actually, I used a table with one row,
and each cell contains one div.) It's really painful to get it right.
And the library appears to fail in IE5.0.


Just to let you know, IE5 has drag-and-drop capabilities via DHTML.
Agreed it's a pain to use them. Maybe for your approach frames are
best. But why do users want to resize the frames? Wouldn't it be an
option to use simple positioned div's with relative width, filling the
whole window, which use overflow-property with scroll?
Jul 20 '05 #4
On Wed, 19 Nov 2003, Kai Grossjohann wrote:
No, I can't point you to the page. I can't make pages available from
behind the company firewall.
I think you just said "I don't want to talk about authoring HTML
for the World Wide Web". Well, that's fine by me.
The objective is to make it look like the corresponding windows
application.


Yup, that pretty much does it.
Jul 20 '05 #5
Kai Grossjohann wrote:
"Philipp Lenssen" <in**@outer-court.com> wrote in message
news:<bp*************@ID-203055.news.uni-berlin.de>...

Why make it so complicated in the first place? Why use JavaScript,
Frames, Cookies? Can you point us to your page so we can see how it
must be frames?


No, I can't point you to the page. I can't make pages available from
behind the company firewall.

It does not *have* to be frames, but the alternatives are even worse.
The objective is to make it look like the corresponding windows
application. The windows app looks like this (ascii art):
...

Was the windows app developed in-house? If yes, I think your best plan is
to build an ocx version of the app and let the users use it from within
Internet Explorer.

--
William Tasso - http://WilliamTasso.com
Jul 20 '05 #6
"Philipp Lenssen" <in**@outer-court.com> wrote in message news:<bp*************@ID-203055.news.uni-berlin.de>...
Kai Grossjohann wrote:

Just to let you know, IE5 has drag-and-drop capabilities via DHTML.
Well, maybe it's just the library I used that has problems with IE5,
or I used the library in the wrong way. (Google for "walter zorn drag
drop" and you'll find the library. It claims to work on IE4+. So
probably this is pilot error, rather than a bug in the library.)
Agreed it's a pain to use them.
Yep...
Maybe for your approach frames are
best. But why do users want to resize the frames? Wouldn't it be an
option to use simple positioned div's with relative width, filling the
whole window, which use overflow-property with scroll?


The draggability might be a dispensable feature, but there is so MUCH
of it in the windows application. I'm afraid that the webapp needs to
provide at least SOME of it...

Kai
Jul 20 '05 #7
"William Tasso" <ne****@tbdata.com> wrote in message news:<bp*************@ID-139074.news.uni-berlin.de>...

Was the windows app developed in-house? If yes, I think your best plan is
to build an ocx version of the app and let the users use it from within
Internet Explorer.


Well, I suggested to use a Java applet, which amounts to the same
thing I guess. There used to be a Java applet, but it had problems,
and now folks are afraid of fat clients...

And then, there is the cross-platform compat thing. I guess that
customers use Windows for the most part, but nevertheless it seems we
need to be able to advertise compatibility with Linux and MacOS and
stuff.

Kai
Jul 20 '05 #8
"Alan J. Flavell" <fl*****@ph.gla.ac.uk> wrote in message news:<Pi*******************************@ppepc56.ph .gla.ac.uk>...
On Wed, 19 Nov 2003, Kai Grossjohann wrote:
No, I can't point you to the page. I can't make pages available from
behind the company firewall.


I think you just said "I don't want to talk about authoring HTML
for the World Wide Web". Well, that's fine by me.


Oops. You're saying I'm off-topic here. Is there a newsgroup
comp.infosystems.INTRANET.authoring.html?
The objective is to make it look like the corresponding windows
application.


Yup, that pretty much does it.


It does me, too. It's difficult for me to tell the difference between
misfeatures and bugs. Sometimes I see something nice and hear that it
is called a bug, and other times I see something awful and hear it
touted as a feature. Oh, well...

Kai
Jul 20 '05 #9
"Kai Grossjohann" <Ka*************@gmx.net> schrieb im Newsbeitrag
news:e8**************************@posting.google.c om...

I have been able to remember the frame width in a cookie by using
JavaScript and onunload events. I have also been able to frob the
frameset definition on load, to replace the default frame widths with
the ones from the cookie. (Actually, the frameset definition is a
JSP, so I can access the cookie from there.)

If you can rely on Javascript being turned on it might be the easiest way to
use only one frameset and load new pages cross-frame with Javascript.

HTH
Markus
Jul 20 '05 #10
"William Tasso" <ne****@tbdata.com> wrote in message news:<bp*************@ID-139074.news.uni-berlin.de>...
Was the windows app developed in-house? If yes, I think your best plan is
to build an ocx version of the app and let the users use it from within
Internet Explorer.


But what if the user wants to use a decent browser instead?

--
Dan
Jul 20 '05 #11
Daniel R. Tobias wrote:
"William Tasso" <ne****@tbdata.com> wrote in message
news:<bp*************@ID-139074.news.uni-berlin.de>...
Was the windows app developed in-house? If yes, I think your best
plan is to build an ocx version of the app and let the users use it
from within Internet Explorer.


But what if the user wants to use a decent browser instead?


I know, I know, but on scanning this thread it became apparent this is an
intranet issue where user choice (often) plays second fiddle to the whims of
IT-support/admin. Sometimes the best course of action is to use the
tools/infrastructure available - if it applies.

--
William Tasso - http://WilliamTasso.com
Jul 20 '05 #12
"Markus Ernst" <derernst@NO#SP#AMgmx.ch> writes:
"Kai Grossjohann" <Ka*************@gmx.net> schrieb im Newsbeitrag
news:e8**************************@posting.google.c om...

I have been able to remember the frame width in a cookie by using
JavaScript and onunload events. I have also been able to frob the
frameset definition on load, to replace the default frame widths with
the ones from the cookie. (Actually, the frameset definition is a
JSP, so I can access the cookie from there.)


If you can rely on Javascript being turned on it might be the easiest way to
use only one frameset and load new pages cross-frame with Javascript.


And what if the user hits the reload button?

Also, I have several subtly different framesets, but maybe I could
work around this to make them all be similar enough for your approach
to work. But that leaves the reload problem.

Kai
Jul 20 '05 #13
Ka*************@gmx.net (Kai Grossjohann) wrote in message news:<e8**************************@posting.google. com>...

WIBNI the webapp could remember the frame sizes across reloads and
frameset changes? For example, if the user resizes the menu bar frame
after login, then it should retain the width even after the user
chooses a search form, and after performing the search.

[...]

But I was wondering if there is a generic approach so that I don't
have to write special code for each and every frame. Is there?


I've now done the following. In the frameset spec I do like this:

<frameset onload="restore_frameset('mainarea');"
onunload="remember_frameset('mainarea');"
...other.params...>
<frame ...>
<frameset id="mainarea" rows="1,2,3" ...other.params...>
...
</frameset>
</frameset>

Now remember_frameset gets the right element from the id, then
iterates over all child frames, and looks at their name. It also
splits the rows attribute. Then it generates a cookie frm_height_foo
for each frame foo which contains the right height. (If the frameset
specifies columns instead, it looks at the cols attribute and stores
in the cookie frm_width_foo.)

The restore_frameset function does similar, it goes through all child
frames, looks to see if there is a cookie for it, and if so, the size
is adjusted accordingly.

Matters are slightly complicated by the fact that IE 5 does not change
the rows/cols attribute when the user drags the frame separator.
Thus, I look at the document.body.offset{Width,Height} properties, if
available.

I hope this makes sense and perhaps it helps someone. Probably it's
quite stupid, but I'm just a newbie...

Kai
Jul 20 '05 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Paul | last post by:
I have a simple frame-based application where title information appears in a top frame and a lower frame contains the content for the application. One of the needs for this app is for a status...
2
by: Jesse Quijano | last post by:
Oh gurus, please save me from myself! I've created a site with frames in the configuration below: The "main" page consists of one frameset and two frames(rows). 1) The navigation/search bar...
1
by: Steve Karnath | last post by:
Hello All, The page I am using is a frameset page (2framepage.htm) with 2 frames (mainframe & headerframe). From this page I have a link that opens a different frameset page (3framepage.htm)...
5
by: Frame | last post by:
I'm looking for tutorials or articles considering HTML Frames and how to handle them with Javascript. E.g. samples how Frames can exchange information, can a Frame instruct other Frame to update...
9
by: books1999 | last post by:
I have framset with leftFrame, mainFrame, TopFrame. I found this script : http://www.dynamicdrive.com/dynamicindex8/collapsemain.htm I wonder if it could be ajusted so that it collapses the...
8
by: moondaddy | last post by:
Are frame pages really taboo in asp.net and if so, why and what's the down side of using them? I'm trying to use user controls instead, but it seems that a lot of things were a lot easier with...
11
by: Rob | last post by:
I know, I know, don't use frames. Well, I'm stuck with these frames and I'm trying to add functionality without a complete redsign. You can look at this as a nostalgic journey. Anyway, I've got...
6
by: Richard Maher | last post by:
Hi, Now that I am aware that JS on a page in Frame A can directly call a function on a page in Frame B, I no longer have to continue with my frameB.location.reload() fudge in order to get some...
4
by: adamalton | last post by:
Hi, I have a frameset with a menu down the left and a main frame on the right. (The menu contains a flash jukebox, which I why it's in a frame, so that you don't have to restart the jukebox every...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.