Details
-
Type: Improvement
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 2.0-Alpha1
-
Fix Version/s: 2.0-Alpha3, 2.0.0
-
Labels:None
-
Environment:server
Description
Rather than force a page reload (which is a non-Faces GET request and can discard user input), it should be possible to specify "head" requirements at the application level (also temporary, until we understand why adding script to the body is not sufficient).
Issue Links
Activity
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion
To detect DOM differences that reach the 'head' or 'body' elements the fix adds temporarily 'id' attributes to these elements if they're missing. By doing this the diff process will stop before reaching the 'html' element.
The 'body' update is applied properly by the JSF bridge as long as the update will look like:
<update id="javax.faces.ViewBody"><![CDATA[<body>.......</body>]]></update>
The expected 'head' update looks similar:
<update id="javax.faces.ViewHead"><![CDATA[<head>.......</head>]]></update>
Unfortunately the update is not handled currently (JSF 2.0.2) by JSF. In the future we could bypass the 'head' level update by sending 'eval' commands back to the bridge. These code sent can modify dynamically the existing head element using other JS APIs. See:
http://www.hunlock.com/blogs/Howto_Dynamically_Insert_Javascript_And_CSS
http://www.hunlock.com/blogs/Totally_Pwn_CSS_with_Javascript