Richfaces a4j:包括加载两个页面?
我的 JSF 主页面上有这段看似无害的代码:
<a4j:outputPanel id="sidebarContainer">
<a4j:include viewId="#{UserSession.currentSidebar}"/>
</a4j:outputPanel>
以下是侧边栏的更改方式:
A jsFunction 调用一个 backing-bean 方法,该方法在 UserSession 中设置页面(如“sidebar2.jsp”)
jsFunction 具有“rerender='sidebarContainer'”,以便在侧边栏中加载正确的页面
当 Web 应用程序最初在 JBoss 5 中启动时,当我调用 jsFunction 更改页面时,出现了 sidebar2,但原来的侧边栏(sidebar1.js)出现了。 jsp) 出现在其下方。
在经历了最初的怪异之后,侧边栏切换工作得很好。有什么想法吗?
I have this seemingly-innocent code on my main JSF page:
<a4j:outputPanel id="sidebarContainer">
<a4j:include viewId="#{UserSession.currentSidebar}"/>
</a4j:outputPanel>
Here is how the sidebar changes:
A jsFunction calls a backing-bean method which sets the page (like "sidebar2.jsp") in UserSession
The jsFunction has "rerender='sidebarContainer'", so that the correct page is loaded in the sidebar
When the web application is initially started in JBoss 5, when I call the jsFunction to change pages, sidebar2 appears, but the original sidebar (sidebar1.jsp) appears below it.
The sidebar switching works just fine after this initial wierdness. Any thoughts??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题似乎在于,在调用 AJAX 请求来更改侧边栏的同时,还发生了另一个 AJAX 请求。我们现在正在采取一些解决方法。
我在 RichFaces 4 alpha 2 的注释中注意到,由于 RichFaces4 使用 JSF 2 f:ajax 功能,基本上,AJAX 请求是序列化的,因此在任何给定时刻只能进行一个请求。因此,当我们转向 RichFaces 4 时,我们的问题应该得到解决。
What seems to be the problem was that another AJAX request is happening at the same time that the AJAX request was called to change sidebars. We're putting in a few workarounds for now.
I noticed in the notes for RichFaces 4 alpha 2 that since RichFaces4 uses the JSF 2 f:ajax functionality, basically, AJAX requests are serialized so that only one can be underway at any given moment. So when we move to RichFaces 4 our problem should be solved.