Em Tue, 17 Feb 2009 16:48:05 -0300, Luther Baker <lutherba...@gmail.com>
escreveu:
Now consider List.tml:
If I use a t:Grid out of the box, I get a runtime complaint when I try to
display a Topic,
"does not contain a property named 'classification'"
I assume this is because 'Classification' is not on the list of simple
types that Tapestry currently knows about. Strings, booleans, numbers,
etc.
Absolutely right. :)
So, I add a defaultDataTypeAnalyzer:
public static void
contributeDefaultDataTypeAnalyzer(MappedConfiguration<Class<?>, String>
configuration)
{
configuration.add(Classification.class, "classification");
}
I'm not sure why assigning the name "classification" Classification
suddenly makes this work ...
I guess it works because someone told Tapestry that it is a known type.
but as soon as I do this, the t:Grid successfully
displays a Classification column - and populates it by invoking
Classification.toString(). Is that behavior overridable?
Yes. You would need to give Tapestry a block to render Classifications.
There, you can do whatever you want.
Is it safe to say I don't need any other moving parts for this to work
this way going forward?
You'll probably want an edition block when you edit Topics . ..
is there a special way to explicitly control how Classification DISPLAY's
itself (right now it invokes Classification.toString()) ? (ie: is there a
group of classes that work together similar to t:BeanEditForm?)
Yes. You would need to give Tapestry a block to render Classifications.
There, you can do whatever you want.
Grid, BeanEditForm, BeanDisplay, and BeanEditor all use the same
BeanModel, view block and edit block infrastructure.
In the t:BeanEditForm - one creates xhtml blocks - but it doesn't appear
necessary for t:Grid. Is that because t:Grid is only DISPLAYing the
property?
Yes. From now on, all your questions have already been answered. ;)
--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org