You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by Apache Wiki <wi...@apache.org> on 2011/08/31 02:28:07 UTC

[Myfaces Wiki] Update of "Drafts/WindowId" by LeonardoUribe

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Myfaces Wiki" for change notification.

The "Drafts/WindowId" page has been changed by LeonardoUribe:
http://wiki.apache.org/myfaces/Drafts/WindowId?action=diff&rev1=4&rev2=5

  
  in codi we have automatedEntryPoint to allow that external apps can query pages without creating new windows.
  
+ = DRAFT: Discussion .... =
+ 
+ It is frequent to find questions about how to create multi-window web applications with JSF. Prove of that are the following list of issues sent
+ to MyFaces issue tracker (https://issues.apache.org/jira/browse/MYFACES):
+ 
+ - MYFACES-32 Multiple browser window problem with server state saving
+ - MYFACES-1206 JSR-252 Issue #11: Provide a unique window identifier to accomodate applications that have multiple instances of the same view, 
+   but perhaps in different browser windows or frames.
+ - MYFACES-1791 state management and multiple frames
+ - MYFACES-3100 Repeated postbacks create additional serialized views
+ - MYFACES-3117 Current server state saving implementation prevents multi-window usage
+   
+ On http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC
+ 
+ - JAVASERVERFACES_SPEC_PUBLIC-11 Frames: StateSaving: unique window id for each view
+ - JAVASERVERFACES_SPEC_PUBLIC-949 Window-id
+ 
+ On http://java.net/jira/browse/JAVASERVERFACES
+ 
+ - JAVASERVERFACES-121 Store Session States on a per window and viewid basis
+ 
+ The first intention to understand the problem and implement something on MyFaces was done by Mario Ivankovits on this article: 
+ 
+ http://myfaces.apache.org/orchestra/myfaces-orchestra-core/multiwindow.html
+ 
+ More recently, there was some discussions and other additional steps to understand this better :
+ 
+ http://markmail.org/message/7yrh7267lr5jauua?q=[core]+Enhancements+to+State+Saving+Caching+Algorithm 
+ 
+ Some libraries like Trinidad (ADF Faces), Icefaces, MyFaces CODI and others usually provide some partial hacks to deal with such use cases. 
+ Unfortunately, any of those hacks have side effects, because each one could implement a variant of the known solutions:
+ 
+ 1. Embedding a window-id in a hidden field
+ 2. Embedding a window-id in a cookie
+ 3. Embedding a window-id in the URL
+ 4. Post-render detection of Window Properties (javascript code on page and check some property there after load page)
+ 
+ To keep things simple, from MyFaces Core (or JSF Impl) point of view it this concept is relevant because:
+ 
+ - Instead rely on such specific hacks, it could be good to have a simple way to identify a window, so other libraries can just use it.
+ - It could make possible to implement WindowScope on top of this (using the windowId as a key for retrieve the scope relative values).
+ - State handling mechanics could use it to identify a view with the same name. That could make possible things like remove other views
+ coming from the same window and prevent "double button" or "back button" problem from server side.   
+ 
+ Frameworks like Stripes has a Flash Scope that support multiple windows using a query param. MyFaces Core Flash scope uses a Cookie, so in a 
+ multi-window app it will not work correctly.
+ 
+ Common use cases:
+ 
+ 1. Use target="_blank"
+ 
+ {{{
+ <form action="/faces/file.xhtml" method="POST" target="_blank"> 
+ ...
+ </form>
+ }}}
+ 
+ 2. Use window.open :
+ 
+ {{{
+ <form action="/faces/file.xhtml" method="POST" target="foo" onsubmit="window.open('', 'foo', 'width=450,height=300,status=yes,resizable=yes,scrollbars=yes')"> 
+ ...
+ </form>
+ }}}
+