Hi All,

I seem to be having trouble getting my component to render informal
parameters, see enclosed classes, I can only get the informals to render on
the container element, not on the component itself. 

So I have my Inf component which uses a tml - the compnent div already
having an 'existing' attribute, but does not define a t:body element. I use
the component in my InfTest page like so:
<div id="someDiv">
<t:inf inf1="inf1">
</div>

I would expect:
<div id="someDiv">
<div existing="existing" inf1="inf1">Inf Component</div>
</div>

but get:
<div id="someDiv" inf="inf1">
<div existing="existing">Inf Component</div>
</div>


I've tried the various render phase methods but I'm still getting this
behaviour. I've looked at the code for other components but they seem to
build the output in code without a template.

Environment:
OS X 10.5.3
Java 1.5.0_13
Tapestry 5.0.14-20080621.110019-10

Any ideas?


/**
 * A simple component with a template that should render its informal params
 */
@SupportsInformalParameters
public class Inf {

        @Inject
        private ComponentResources res;

        // @BeginRender seems to render the components informals to the 
containing
element, not the
        // component element
        @BeginRender
        void renderInfs_BeginRender(MarkupWriter writer) {
                // res.renderInformalParameters(writer);
        }

        // BeforeRenderTemplate seems to render the components informals to the
containing element, not the
        // component element
        @BeforeRenderTemplate
        void renderInfs_BeforeRenderTemplate(MarkupWriter writer) {
                // res.renderInformalParameters(writer);
        }

        // @BeforeRenderBody does not render any informals anywhere, probably 
not
called as this component does not define a <t:body/> in the tml
        @BeforeRenderBody
        void renderInfs_BeforeRenderBody(MarkupWriter writer) {
                // res.renderInformalParameters(writer);
        }

        // @AfterRenderBody does not render any informals anywhere, probably not
called as this component does not define a <t:body/> in the tml
        @AfterRenderBody
        void renderInfs_AfterRenderBody(MarkupWriter writer) {
                // res.renderInformalParameters(writer);
        }

        // @AfterRenderTemplate seems to render the components informals to the
containing element, not the
        // component element
        @AfterRenderTemplate
        void renderInfs_AfterRenderTemplate(MarkupWriter writer) {
                // res.renderInformalParameters(writer);
        }

        @AfterRender
        // @AfterRender seems to render the components informals to the 
containing
element, not the
        // component element
        void renderInfs_AfterRender(MarkupWriter writer) {
                // res.renderInformalParameters(writer);
        }

}

Inf.tml
<div existing="existing"
xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
        Inf Component
</div>


InfTest.tml
<div xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>

<!-- This inf component should render with 'existing' and 'inf1' attributes
-->
<t:inf inf1="inf1">Hi</t:inf>

</div>
-- 
View this message in context: 
http://www.nabble.com/RenderInformals-on-Component-With-Template-tp18053261p18053261.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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

Reply via email to