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.


Michael Gerzabek wrote:
> Hi,
> 
> Another question from a newbie. What would it take to read the text 
> surrounded by <t:label for="someAttribute">A pretty label 
> text:</t:label> and use this if no .properties are provided?
> 
> Michael
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to