FAQ
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 GerhardPetracek:
http://wiki.apache.org/myfaces/Drafts/WindowId

New page:
= intro =

here we collect ideas for [[http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-949]]

= new apis =

= new components =

= new attributes for existing components =

Search Discussions

  • Apache Wiki at Aug 28, 2011 at 5:47 pm
    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 GerhardPetracek:
    http://wiki.apache.org/myfaces/Drafts/WindowId?action=diff&rev1=1&rev2=2


    = new attributes for existing components =

    + command components should get the following new attribute(s) to control the window-id (e.g. to open a popup with a different window-id). this information has to be sent as request parameter (javax.faces.windowId), because the information needs to be available before restoring the view.
    +
    + * windowId (default: current values current|new|none)
    +
    + if no information is provided via javax.faces.windowId, the windowId parameter of the url will be used (if it exists, otherwise a new window-id will be created).
    +
    + = implicit variables =
    +
    + = storing the window-id =
    +
    + the usual strategy is to store the window-id in the url due to the different browser restrictions. we could also do it via state-saving but there are also cases which would break the whole mechanism (e.g. a page refresh (and e.g. there is no form with input components) or pressing enter in the address-space). some of those cases already break the view-scope.
    +
    + the only problems with the window-id in the url are:
    + 1. pretty urls
    + 2. opening an url in a new window.
    +
    + solutions:
    + for 1) window-ids shouldn't be active by default to ensure backward compatibility and with html5 it's possible to rewrite the url on the client-side
    + for 2) there is a script which detects it - we have to render it (see http://old.nabble.com/-CODI--lazy-windowId-drop-script-p31654496.html)
    +
  • Apache Wiki at Aug 29, 2011 at 8:21 pm
    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 GerhardPetracek:
    http://wiki.apache.org/myfaces/Drafts/WindowId?action=diff&rev1=2&rev2=3

    1. pretty urls
    2. opening an url in a new window.

    - solutions:
    + possible solutions:
    for 1) window-ids shouldn't be active by default to ensure backward compatibility and with html5 it's possible to rewrite the url on the client-side
    for 2) there is a script which detects it - we have to render it (see http://old.nabble.com/-CODI--lazy-windowId-drop-script-p31654496.html)

    + known limitations:
    + for 2) the page gets loaded before the window-id can be discarded. that might lead to an unexpected request and therefore an unexpected behaviour. -> we have to think about a request token.
    +
  • Apache Wiki at Aug 29, 2011 at 11:10 pm
    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 GerhardPetracek:
    http://wiki.apache.org/myfaces/Drafts/WindowId?action=diff&rev1=3&rev2=4

    here we collect ideas for [[http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-949]]

    = new apis =
    +
    + FacesContext#getWindowId independent of other apis, new artifacts,... we should provide this method to expose the current window-id easily.

    = new components =

    @@ -15, +17 @@

    * windowId (default: current values current|new|none)

    if no information is provided via javax.faces.windowId, the windowId parameter of the url will be used (if it exists, otherwise a new window-id will be created).
    + we need "none" e.g. for old command components which don't have this attribute. in this case we might need a fallback (depending on what we want to support).

    = implicit variables =

    @@ -33, +36 @@

    known limitations:
    for 2) the page gets loaded before the window-id can be discarded. that might lead to an unexpected request and therefore an unexpected behaviour. -> we have to think about a request token.

    + = misc =
    +
    + in codi we have automatedEntryPoint to allow that external apps can query pages without creating new windows.
    +
  • Apache Wiki at Aug 31, 2011 at 2:00 am
    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 GerhardPetracek:
    http://wiki.apache.org/myfaces/Drafts/WindowId?action=diff&rev1=7&rev2=8

    = intro =

    - here we collect ideas for [[http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-949]]
    + here we collect ideas for [[http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-949]] btw. [[JAVASERVERFACES_SPEC_PUBLIC-949 Window-id]]
    +
    + this site contains:
    + * possible approaches to detect a window based on different kind of IDs
    + * possibilities for closing logical windows (represented by an ID) and opening new logical windows manually
    +
    + this site doesn't include:
    + * information for a concrete scope
    +
    + the result can be used for:
    + * window distinction
    + * state (including custom-scope) history per window -> back button support
    + * double submit prevention

    = new apis =

    @@ -42, +54 @@


    = DRAFT: Discussion .... =

    + Some libraries like Trinidad (ADF Faces), Icefaces, MyFaces CODI and others usually provide some partial hacks to deal with such use cases. Only the client-side window-handler is a completely working solution with the drawbacks of page-flickering and the incompatibility with libs like PrettyFaces.
    - 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):

    + Known solutions for storing the window-id on the client-side (which doesn't support all use-cases on the client-side):
    - * 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
    + 1. Hidden field
    + No support for GET requests
    + 2. Cookie only
    + Doesn't work at all
    + 3. Cookie which gets set via js directly before the request (request-id is stored in the url + a request-id in window.name)
    + Also supports GET requests -- possible problem (depending on the browser): parallel windows which poll frequently; additional mouse buttons e.g. binding of the middle mouse button)
    + 4. URL only
    + Clones a window with "open in new tab" and similar
    + 5. URL + request-id in a hidden field for POST requests and
    + the logic of javascript:document.location = this.href + ' & amp ; ' + window.name /*stores the request-id*/; return false; as autom. chained code for GET requests
    + 6. sessionStorage of HTML5
    + Looks promising with Firefox but not with other browsers

    - On http://java.net/jira/browse/JAVASERVERFACES
    + == Misc ==

    - * JAVASERVERFACES-121 Store Session States on a per window and viewid basis
    + == Further readings ==

    - The first intention to understand the problem and implement something on MyFaces was done by Mario Ivankovits on this article:
    + * [[http://java.net/jira/browse/JAVASERVERFACES-121]]
    + * [[http://myfaces.apache.org/orchestra/myfaces-orchestra-core/multiwindow.html]]
    + * [[http://markmail.org/message/7yrh7267lr5jauua?q=[core]+Enhancements+to+State+Saving+Caching+Algorithm ]]

    - http://myfaces.apache.org/orchestra/myfaces-orchestra-core/multiwindow.html
    + == Other Frameworks ==

    - More recently, there was some discussions and other additional steps to understand this better :
    + Frameworks like Stripes has a Flash Scope that support multiple windows using a query param.

    - 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:
    + == Common use cases ==

    1. Use target="_blank"
  • Apache Wiki at Aug 31, 2011 at 2:04 am
    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 GerhardPetracek:
    http://wiki.apache.org/myfaces/Drafts/WindowId?action=diff&rev1=8&rev2=9

    = intro =

    - here we collect ideas for [[http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-949]] btw. [[JAVASERVERFACES_SPEC_PUBLIC-949 Window-id]]
    + here we collect ideas for [[http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-949]] btw. [[http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-11]]

    this site contains:
    * possible approaches to detect a window based on different kind of IDs
  • Apache Wiki at Aug 31, 2011 at 2:11 am
    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 GerhardPetracek:
    http://wiki.apache.org/myfaces/Drafts/WindowId?action=diff&rev1=9&rev2=10

    here we collect ideas for [[http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-949]] btw. [[http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-11]]

    this site contains:
    - * possible approaches to detect a window based on different kind of IDs
    + * possible approaches to detect a window based on different kinds of IDs
    * possibilities for closing logical windows (represented by an ID) and opening new logical windows manually

    this site doesn't include:
    - * information for a concrete scope
    + * information about a concrete scope

    the result can be used for:
    * window distinction
    - * state (including custom-scope) history per window -> back button support
    + * state (including custom-scope) history per window -> basic back-button support
    * double submit prevention

    = new apis =
    @@ -54, +54 @@


    = DRAFT: Discussion .... =

    - Some libraries like Trinidad (ADF Faces), Icefaces, MyFaces CODI and others usually provide some partial hacks to deal with such use cases. Only the client-side window-handler is a completely working solution with the drawbacks of page-flickering and the incompatibility with libs like PrettyFaces.
    -
    Known solutions for storing the window-id on the client-side (which doesn't support all use-cases on the client-side):

    1. Hidden field
    @@ -70, +68 @@

    the logic of javascript:document.location = this.href + ' & amp ; ' + window.name /*stores the request-id*/; return false; as autom. chained code for GET requests
    6. sessionStorage of HTML5
    Looks promising with Firefox but not with other browsers
    -
    + 7. Client-side window-handler of CODI
    + A completely working solution with the drawbacks of page-flickering and the incompatibility with libs like PrettyFaces.
    == Misc ==

    == Further readings ==
  • Apache Wiki at Aug 31, 2011 at 2:27 am
    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 GerhardPetracek:
    http://wiki.apache.org/myfaces/Drafts/WindowId?action=diff&rev1=10&rev2=11

    Known solutions for storing the window-id on the client-side (which doesn't support all use-cases on the client-side):

    1. Hidden field
    - No support for GET requests
    + No support for GET requests and manual page refreshes if there is no form with input fields
    2. Cookie only
    Doesn't work at all
    - 3. Cookie which gets set via js directly before the request (request-id is stored in the url + a request-id in window.name)
    - Also supports GET requests -- possible problem (depending on the browser): parallel windows which poll frequently; additional mouse buttons e.g. binding of the middle mouse button)
    - 4. URL only
    + 3. URL only
    Clones a window with "open in new tab" and similar
    + 4. URL (window-id) + Cookie (request-id) which gets set via js directly before the request + reset of the Cookie asap
    + Also supports GET requests -- possible problem (depending on the browser): parallel windows which set the cookies in parallel; additional mouse buttons e.g. binding of the middle mouse button)
    5. URL + request-id in a hidden field for POST requests and
    the logic of javascript:document.location = this.href + ' & amp ; ' + window.name /*stores the request-id*/; return false; as autom. chained code for GET requests
    6. sessionStorage of HTML5
    Looks promising with Firefox but not with other browsers
    7. Client-side window-handler of CODI
    A completely working solution with the drawbacks of page-flickering and the incompatibility with libs like PrettyFaces.
    +
    == Misc ==

    == Further readings ==
  • Apache Wiki at Aug 31, 2011 at 2:31 am
    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 GerhardPetracek:
    http://wiki.apache.org/myfaces/Drafts/WindowId?action=diff&rev1=11&rev2=12

    Doesn't work at all
    3. URL only
    Clones a window with "open in new tab" and similar
    + 4. URL + js for detecting new windows (see [[http://old.nabble.com/-CODI--lazy-windowId-drop-script-p31654496.html]])
    - 4. URL (window-id) + Cookie (request-id) which gets set via js directly before the request + reset of the Cookie asap
    + 5. URL (window-id) + Cookie (request-id) which gets set via js directly before the request + reset of the Cookie asap
    Also supports GET requests -- possible problem (depending on the browser): parallel windows which set the cookies in parallel; additional mouse buttons e.g. binding of the middle mouse button)
    - 5. URL + request-id in a hidden field for POST requests and
    + 6. URL + request-id in a hidden field for POST requests and
    the logic of javascript:document.location = this.href + ' & amp ; ' + window.name /*stores the request-id*/; return false; as autom. chained code for GET requests
    - 6. sessionStorage of HTML5
    + 7. sessionStorage of HTML5
    Looks promising with Firefox but not with other browsers
    - 7. Client-side window-handler of CODI
    + 8. Client-side window-handler of CODI
    A completely working solution with the drawbacks of page-flickering and the incompatibility with libs like PrettyFaces.

    == Misc ==

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommits @
categoriesmyfaces
postedAug 20, '11 at 12:11a
activeAug 31, '11 at 2:31a
posts9
users1
websitemyfaces.apache.org

1 user in discussion

Apache Wiki: 9 posts

People

Translate

site design / logo © 2019 Grokbase