TOC PREV NEXT INDEX

Concurrent DOM Views


By default, each ICEfaces user can have only one dynamically updated page per web application. In this configuration, a single DOM is maintained for each user session. Reloading an ICEfaces page synchronizes the browser to the server-side DOM. Opening a new browser window into the same application, however, leads to page corruption as DOM updates may be applied unpredictably to either window.

To allow multiple windows for a single application, concurrent DOM views must be enabled. See Configuring web.xml to configure the web.xml file for concurrent DOM views.

With concurrent DOM views enabled, each browser window is distinctly identified with a view number and DOM updates will be correctly applied to the appropriate window. This introduces some important considerations for the application data model. Managed beans in session scope can now be shared across multiple views simultaneously. This may be the desired scope for some states, but typically, presentation-related state is more appropriately kept in request scope. For example:

	<managed-bean> 
 
		<managed-bean-name>BoxesCheckedBean</managed-bean-name> 
 
		<managed-bean-class>com.mycompany.BoxesCheckedBean</managed-bean-class> 
 
		<managed-bean-scope>request</managed-bean-scope> 
 
	</managed-bean> 
 
Note: The ICEfaces request scope is typically longer lived than the request scope for non-dynamic applications. An ICEfaces request begins with the initial page request and remains active through user interactions with that page (such user interactions would normally each require a new request). One consideration is that new browser windows and page reloads of the same browser window are both regarded as new requests. Therefore, it is important to implement the dynamic aspects of the ICEfaces application so that asynchronous notifications are applied to all active requests and not just the initial one.

For applications that do not make use of Concurrent DOM views and require request scope to last only for the duration of a single user event, "standard request scope" must be enabled. See Configuring web.xml to configure the web.xml file for "standard request scope".

Table 3 shows a summary of the Managed Bean Scope.

Table 3   Managed Bean Scope
State
Managed Bean Scope
none
For transient data.
request
For typical view-related state, request-scope beans will persist through most user interaction but not through view changes. This is the recommended scope for ICEfaces applications that make use of multiple windows.
session
For state that must be shared across views.
application
For state that must be shared across users.

If concurrent DOM views is configured, and multiple windows are created by the user, ICEfaces uses a single blocking connection to deliver asynchronous updates to all views in the session. This ensures that all views remain current without exceeding the maximum connection limit implemented in the browser. When views are destroyed by the user, it may be necessary to release view-specific resources such as threads or database connections. A listener mechanism has been added to support this.


See The DisposableBean Interface for details.



Copyright 2005-2009. ICEsoft Technologies, Inc.
TOC PREV NEXT INDEX