hourglass issue on firefox when switching tabs
I have a very strange problem in my web application.
I am using icefaces 开发者_StackOverflowwith jsf and on some of my pages (please do not ask for the code because it's a lot of it:) I see the hourglass effect appearing on firefox.
I can clearly confirm that is because, somehow, the jsf cycle is not entirely finished. (all the components are visible but validation is not working).
Please note that this issue does not appear if I press F5 but only when I switch some tabs, which basically change the content of the main form)...
Are you guys having any suggestion? Google did not help me...nor Firebug...
UPDATE:
- after further investigation with Firebug it seems that when I do an ajax POST, it does not load the scripts and css which are inside the <body> </body>
(you will see in the answer why it puts some css and scripts here) tag...but only the ones from <head>...</head>
Issue solved!!! (please see my update before continuing reading this answer)
I had this code in my main template:
<head>
<ui:include
src="/WEB-INF/jsf/common/templates/main/commonResources-include.xhtml" />
</head>
Now please note that commonResources-include.xhtml has this code (please note html tags!)
<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets">
..code..
</html>
It seems that whenever you use these facelets components to be included, templating etc you MUST use <ui:composition>
tags and not <html>
, because html tags will confuse the rendering engine of the browser! What is strange is that a lot of examples from the internet use html tags for these facelets which do not give issues in helloWorld examples but can be a pain in complex applications!
So, the final code:
<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets">
..code..
</ui:composition>
精彩评论