Hi Nick, That was REALLY easy! Wow, 5 minutes and a new component is born. It's hard to believe. The more I work with T5 the more I like it.
So let's have a look at RadioGroup... Cheers, Michael Nick Westgate schrieb: > Hi Michael. > > In the future it should be easy to do this with a Mixin, but there are > a couple of problems that might (or might not) get in the way currently. > > Anyway, it's very easy to write components. Just take the Radio.java > source eg from http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/ > tapestry-core/src/main/java/org/apache/tapestry/corelib/components > > and hack away till it does what you want. In this case, change: > @BeforeRenderBody > boolean renderBody() > { > // Don't render the body of the component even if there is one. > > return false; > } > > to return true based on the criteria you want, and the opposite here: > @AfterRender > void after(MarkupWriter writer) > { > writer.write(_field.getLabel()); > > writer.end(); // label > } > > To see how to write your own components and where to put things see: > http://wiki.apache.org/tapestry/Tapestry5HowTos > > Note that if you are using T5.0.6 then a few things have changed like > templates are now named *.tml. Search the list for other changes. > > Cheers, > Nick. > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]