[Seaside] Question about WATree

Brian Brown rbb at techgame.net
Thu Nov 23 00:25:00 UTC 2006


Hello all,

I'm trying to use WATree with a relational database on the back end -  
it doesn't seem to want to go beyond the second level.

I'm using it with ROE, and creating it as such:

setupTree
	^ WATree new
		root: (categories where: #parentid equals: -1) asArray first;
		labelBlock: [:cat | cat name];
		childrenBlock: [:cat | categories where: #parentid equals: cat id];
		yourself


The data looks like this(If you look at in in monspace, it's easier  
to read :):
  id |         name          
|                                                                      
description                                                              
         |      image      | parentid
----+---------------------- 
+----------------------------------------------------------------------- 
------------------------------------------------------------------------ 
------+-----------------+----------
   0 | Top                  | Top Level  
Categories                                                               
                                                                   |  
educational.png |       -1
   2 | Independent Living   | Tasks for independent and supported  
living, such as cooking, cleaning, money management, using household  
appliances, and practicing healthy living. | independent.png |        0
   3 | Educational          | Tasks for academic settings, such as  
using the library, recognizing bird songs, or learning the sounds of  
musical instruments.                      | educational.png |        0
   4 | Vocational           | Work related tasks, such as using a FAX  
machine, cleaning offices, filling out a time card,  
etc.                                                    |  
vocational.png  |        0
   5 | Recreation & Leisure | Task instructions for activities, such  
as learning to play games, learning about local parks and museums,  
etc.                                      | recreation.png  |        0
   6 | Community Access     | Assistance for community-based  
activities, such as taking the bus, using a pay phone, using an ATM,  
learning traffic signs, etc.                    | community.png    
|        0
   7 | Health & Wellness    | Medical and Hygiene  
related                                                                  
                                                         |  
health.png      |        0
   9 | Cooking              | Preparing meals  
independently                                                            
                                                             |  
cooking.png     |        2
10 | Breakfast            | Preparing Breakfast  
meals                                                                    
                                                         |  
cooking.png     |        9
11 | How To               | How to do various  
things                                                                   
                                                           |  
cooking.png     |        3
12 | Other                | Not  
categorized                                                              
                                                                         
  | independent.jpg |        0
(11 rows)


The tree comes out like:

-Top
	+Independent Living
	+Educational
	Vocational
	Recreation & Leisure
	Community Access
	Health & Wellness
	Other


... which is perfect. As you can see from the data, Independent  
Living and Educational both have children; clicking on the + does  
nothing. However, the Top entry can be collapsed and expanded at  
will. I have no idea why it won't expand the lower two.

Anyone have any ideas?

thanks!

Brian




More information about the Seaside mailing list