OK, finally got it working. Here is what I did.
I added a dummy column to my table "childcount"
Then within my model class I added:
public static LazyList<Model> getSubCategoryCount(Object parentId)
{
return Category.findBySQL(
, parentId);
}
It is a trick because of course childcount as I create it has nothing to do with the column, but it allows it to pass checks of activeweb instrumentation and classes. If I didn't do this I would get an error illegal / unknown column or some such. Personally I don't mind the dummy column. It makes doing this very very easy.
I slightly violate the use pattern of a model by not returning ALL the columns but really I could add that.
The solution is very elegant once you get to the .ftl file because now all I have to do is loop my result and then reference the count column.
This is much simpler than trying to manage 2 loops one with all the data and the other with the count, or worse trying to inject with javascript somehow.
It applies when you need a count by row item but I would say in general to only use when you are in a complex situation, otherwise follow the model pattern as close as possible. This is exception case.