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 2006/09/26 04:19:16 UTC

[Myfaces Wiki] Update of "Tree2" by DavidChandler

Dear Wiki user,

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

The following page has been changed by DavidChandler:
http://wiki.apache.org/myfaces/Tree2

The comment on the change is:
Added notes on using Tree2 in a portal

------------------------------------------------------------------------------
  http://andrewfacelets.blogspot.com/2006/06/myfaces-tree2-creating-lazy-loading.html
  
  
+ == Using Tree2 in a Portal...by David Chandler ==
+ To run Tree2 with client-side expansion, you need JavaScript in the page {{{<HEAD>}}}. Normally, this gets added by the Tomahawk ExtensionsFilter. This doesn't work in a portal, however, because servlet filters don't run in a portal. There are some patches in MYFACES-434 (portlet filter) you may be able to use, but here's an easier workaround. I've used this successfully with Tomahawk 1.1.3 in both Jetspeed2 and Liferay.
+ 
+ First, use Tree2 with server-side expansion so as not to require JavaScript. The ExtensionsFilter is therefore needed only to serve up the image resources needed by Tree2, and image requests are handled through the Faces Servlet, not the portal, so the ExtensionsFilter will run as normal for these requests. However, Tomahawk 1.1.3 checks to see if the ExtensionsFilter has been configured, which fails in the portal context. Fortunately, you can disable the check with a web.xml context param.
+  
+ So to summarize, you can use Tree2 1.1.3 in a portal without any of the MYFACES-434 patches if
+  
+  1. You use server-side toggle
+  1. You configure ExtensionsFilter as normal for the Faces Servlet
+  1. You disable the ExtensionsFilter configuration check as follows in web.xml:
+  
+ {{{
+     <context-param>
+         <param-name>org.apache.myfaces.CHECK_EXTENSIONS_FILTER</param-name>
+         <param-value>false</param-value>
+     </context-param>
+ }}}
+ 
+ /dmc
+ 
  == Notes ==
  === Errors ===
  In the 1.0.9 version of MyFaces extensions, this author regularly got errors from tree2 after extensive use. When using the client-side interaction (JavaScript), the expansion state of the nodes of the tree is stored in a cookie, which is discarded when the "user session" ends. On some browsers, this could mean the cookie will only disappear when the browser is quit. When these errors started occuring, quitting and relaunching the browser solved the problem every time.