[英]JSF2 / Primefaces layout performance
Right now I'm using a full page layout and p:layoutUnits and page composition in my webapp. 现在,我在Web应用程序中使用了完整的页面布局以及p:layoutUnits和页面组成。 I have a fixed header with a menubar, and a content layoutunit, and that's all.
我有一个带有菜单栏和内容layoutunit的固定标题,仅此而已。 It was easy to set up, but in IE (7) when I navigate to a new page the whole page reloads (visibly), the header is cleared then loaded, and - even more annoyingly - the menubar is displayed for a second with all the menuitems visible.
设置很容易,但是在IE(7)中,当我导航到一个新页面时,整个页面(可见)重新加载,标题被清除然后加载,而且更令人讨厌的是,菜单栏显示了所有内容菜单项可见。
In other browsers this effect is not really visible, sadly, IE 7 is my target. 在其他浏览器中,这种效果并不十分明显,可悲的是,IE 7是我的目标。
Now I'm thinking about saying goodbye to p:layoutUnits and implementing the layout with simple css magic and fixed div for the header - would it improve display in IE? 现在,我正在考虑与p:layoutUnits告别,并使用简单的CSS魔术和标题的固定div实现布局-它将改善IE中的显示吗? Is there anything else I can do to make it faster and smoother?
我还能做些什么使它更快更流畅? I'd like it to look like the header is not changing at all, only the content.
我希望它看起来标头根本没有改变,只是内容没有改变。
How about using iframe ? 使用iframe怎么样? Would it allow bookmarkable URLs?
会允许添加书签的网址吗?
I see this is an old question, but I'll throw in a new answer anyway... 我看到这是一个古老的问题,但无论如何我都会提出一个新的答案...
PrimeFaces 3.0 <p:dataTable>
supports in-table scrolling. PrimeFaces 3.0
<p:dataTable>
支持表内滚动。 You set a fixed height and width for the data table on your page and within that box the data table is rendered with a scrollbar. 您在页面上为数据表设置了固定的高度和宽度,并在该框中用滚动条呈现了数据表。 The column headers and footers stay put and you just scroll the rows.
列标题和页脚保持不变,而您只需滚动行。 They just cleaned up some format bugs in their nightly snapshot builds that make the
<p:dataTable>
look great in IE 7. Might be worth a second look at PrimeFaces for those who (like me) have to support older IE browsers. 他们只是清理了夜间快照版本中的一些格式错误,这些错误使
<p:dataTable>
在IE 7中看起来很棒。对于像我这样必须支持较旧的IE浏览器的用户来说,值得再看一下PrimeFaces。
LINK: PrimeFaces 3.0 Showcase (scrollable data table) 链接: PrimeFaces 3.0 Showcase(可滚动数据表)
For those struggling with layouts, follow BalusC and use simple divs/css and JSF 2.0 Templating. 对于那些在布局上苦苦挣扎的人,请遵循BalusC并使用简单的divs / css和JSF 2.0模板。 I started with PrimeFaces layouts and could never get it to work with complicated designs.
我从PrimeFaces布局开始,但永远无法使其用于复杂的设计。
http://www.mkyong.com/jsf2/jsf-2-templating-with-facelets-example/ http://www.mkyong.com/jsf2/jsf-2-templating-with-facelets-example/
I've finally decided to say goodbye to p:layout. 我终于决定告别p:layout。 I have a long table that's two or three times the size of the screen.
我有一张长桌子,它是屏幕大小的两到三倍。 If I put it in a scrollable layoutUnit then the scrolling is so slow that it is really annoying (tested in IE, Firefox and Chrome - equally slow).
如果我将其放在可滚动的layoutUnit中,则滚动是如此之慢,以至于它确实很烦人(在IE,Firefox和Chrome中进行了测试-同样缓慢)。 Perhaps this widget was not intended for this kind of use (displaying scrollable, long content), but now it is clear that I'll have to do a proper CSS design and stay with raw DIVs.
也许此窗口小部件并非旨在用于这种用途(显示可滚动显示的长内容),但现在很明显,我将必须进行适当的CSS设计并保留原始DIV。
Nevertheless it was great for quickly putting together an application GUI that can be shown to customers. 但是,这对于快速组合可以显示给客户的应用程序GUI很有用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.