myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Myfaces Wiki] Update of "Tree2" by Jan Dockx
Date Thu, 25 Aug 2005 20:18:27 GMT
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 Jan Dockx:
http://wiki.apache.org/myfaces/Tree2

------------------------------------------------------------------------------
  = <t:tree2/> =
  The '''Tree2''' component renders a tree representation of your data with a HTML table.
The tree is dynamic: nodes are expanded or collapsed when the user clicks them. The component
supports both client side interaction through JavaScript, and server side interaction. In
the latter case, each user click results in a request/response cycle, which re-renders the
tree in the new view state.
  
- Note that in the latter case only the visible (expanded) data is sent to the client. In
the first case (client side tree), the entire tree is sent to the browser with every HTML
response. Each node of the tree carries a sizable amount of HTML code with it (think 200 characters
on average, depending on the amount of information you want to show in for a node), and this
information is sent to the browser also for nodes that are not visible to the end user when
the page is rendered, because one of their ancestor nodes is collapsed. If you have a tree,
e.g., 4 levels deep, with 10 children on average for each node, you will transmit 10 + 10^2
+ 10^3 + 10^4 = 11 110 nodes of 200 characters, or 2 222 000 characters, or roughly 2MB of
data. This example should make clear that, although the client side tree gives a very good
user experience, you could grow a bandwith problem very rapidly, so be aware. This tree is
fit for small trees, or medium sized trees on an intranet or over a 
 broadband connection. For large trees, or when you need to take into account low-bandwidth
connections, you should use the server side tree.
+ Note that in the latter case only the visible (expanded) data is sent to the client. In
the first case (client side tree), the entire tree is sent to the browser with every HTML
response. Each node of the tree carries a sizable amount of HTML code with it (think 200 characters
on average, depending on the amount of information you want to show in for a node), and this
information is sent to the browser also for nodes that are not visible to the end user when
the page is rendered, because one of their ancestor nodes is collapsed. If you have a tree,
e.g., 4 levels deep, with 10 children on average for each node, you will transmit 10 + 10^2^
+ 10^3^ + 10^4^ = 11 110 nodes of 200 characters, or 2 222 000 characters, or roughly 2MB
of data. This example should make clear that, although the client side tree gives a very good
user experience, you could grow a bandwith problem very rapidly, so be aware. This tree is
fit for small trees, or medium sized trees on an intranet or over
  a broadband connection. For large trees, or when you need to take into account low-bandwidth
connections, you should use the server side tree.
  
  You can choose between client-side or server-side interaction with the {{{clientSideToggle}}}
attribute. {{{<t:tree2 clientSideToggle="false" ...}}} gives you the servers-side interaction.
{{{true}}} (client-side interaction) is the default for this attribute.
  

Mime
View raw message