还记得重新加载和框架集更改时Web应用程序的框架大小吗? [英] Remember frame sizes for web application across reloads and frameset changes?

查看:110
本文介绍了还记得重新加载和框架集更改时Web应用程序的框架大小吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含不同框架的网络应用程序:菜单栏框架,
搜索表单框架,结果列表框架。根据州的情况,这些帧的子集只有

可用。 (例如,登录后,只有

菜单栏框架允许用户选择搜索表单。

此后,只有菜单栏和搜索表单是可见。)


现在用户可以调整帧的大小。


WIBNI webapp可以记住重新加载时的帧大小

框架集更改?例如,如果用户在登录后调整菜单栏框架

的大小,那么即使在用户选择搜索表单后,也应该保留宽度,并且在执行搜索后。


我已经能够通过使用

JavaScript和onunload事件来记住cookie中的帧宽。我还能够在加载时使用

框架集定义,用来自cookie的

替换默认框架宽度。 (实际上,框架集定义是一个

JSP,所以我可以从那里访问cookie。)


但是我想知道是否有通用的方法这样我就不会为每一帧都写出特殊的代码。有没有?


我也想知道在HTTP会话中存储帧宽度

是否更好,而不是cookie。 (在这种情况下,从$ JSP访问框架宽度会更容易。)但事实证明,很难在JavaScript会话中存储帧宽度,所以

我放弃了这种方法。


建议赞赏。





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

推荐答案

Kai Grossjohann写道:
Kai Grossjohann wrote:

现在用户可以调整大小框架。

WIBNI webapp可以记住重新加载和框架集更改时的框架大小?例如,如果用户在登录后调整菜单栏框的大小,则即使在用户选择搜索表单后,也应该在执行搜索后保留宽度。

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.




为什么一开始就这么复杂?为什么要使用JavaScript,

框架,Cookies?你能指点我们你的页面吗?所以我们可以看到它是如何b / b
必须是帧?



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?


" Philipp Lenssen" <在** @ outer-court.com>在消息新闻中写道:< bp ************* @ ID-203055.news.uni-berlin.de> ...
"Philipp Lenssen" <in**@outer-court.com> wrote in message news:<bp*************@ID-203055.news.uni-berlin.de>...

为什么首先让它变得如此复杂?为什么要使用JavaScript,
Frames,Cookies?你能指点我们到你的页面所以我们可以看到它必须是框架吗?

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?




不,我不能指向你的页面。我不能在公司防火墙后面提供

的页面。


它没有*成为框架,但替代方案更糟糕。

目标是让它看起来像相应的窗口

应用程序。 Windows应用程序看起来像这样(ascii art):


+ ---- + ------ + ------- +

| | | |

| 1 | 2 | 3 |

| | | |

+ ---- + ------ + ------- +


左侧窗格(标记为1)上图)包含一个查询列表

表单名称。单击其中一个显示

中间窗格(2)中的查询表单。输入数据并提交表单会在右侧窗格中显示

结果列表(3)。如果内容太大,每个窗格都是单独的




用户可以使用
鼠标调整窗格1和2的大小,以及

2和3之间的垂直线来调整窗格2和3的大小。


如果1,2,3是三帧,那么我可以免费获得两条

线的可拖动性。


我也尝试使用拖动 - 并删除JavaScript库以绘制

可拖动的垂直线。在该变体中,每个窗格都是由div表示的
(如有必要,带有滚动条),并且拖动

垂直行使用JavaScript来欺骗DOM以使div成为div

宽度调整得当。 (实际上,我使用了一行一行,

,每个单元格包含一个div。)要做到这一点真的很痛苦。

并且库出现了在IE5.0中失败。





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


Kai Grossjohann写道:
Kai Grossjohann wrote:

我还尝试使用拖放式JavaScript库来绘制可拖动的垂直线。在该变体中,每个窗格由div表示(如果需要,使用滚动条),并且拖动
垂直线使用JavaScript来擦除DOM,以便正确调整div
宽度。 (实际上,我使用了一行的表格,
,每个单元格包含一个div。)要做到这一点真的很痛苦。
IE5.0中的库似乎失败了。

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.




只是为了让您知道,IE5通过DHTML具有拖放功能。

同意使用它们很痛苦。也许你的方法框架是最好的b $ b。但为什么用户想要调整帧大小?使用具有相对宽度的简单定位div并不是一个

选项,填充

整个窗口,它使用overflow-property with scroll?



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?


这篇关于还记得重新加载和框架集更改时Web应用程序的框架大小吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆