You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Michael Prescott <mi...@gmail.com> on 2011/11/09 22:25:00 UTC

Rendering Informal Parameters

How do you render informal parameters if your component has a template
file?  I've tried using the RenderInformals mixin, but (somewhat bizarrely)
it puts the informal parameters on the parent element!

Re: Rendering Informal Parameters

Posted by Michael Prescott <mi...@gmail.com>.
Steve, that's fascinating.

On 10 November 2011 22:44, Steve Eynon <st...@alienfactory.co.uk>wrote:

> 'hang on - I just re-read your question...
>
> Are you wanting to specifiy on where in your .tml the informals are
> rendered?
>
> If so, the call to :
>
>    resources.renderInformalParameters(writer);
>
> renders them on the current element. (The RenderInformals Mixin calls
> it on the beginRender() phase event hence the informals are writen to
> the root element.) You probably want something like this (untested,
> obviously! But worth a try):
>
> <div class="render informals here">
>    <t:trigger event="renderInformals"/>
> </div>
>
> void onRenderInformals() {
>    resources.renderInformalParameters(writer);
> }
>
> Steve.
>
>
>
> On 11 November 2011 11:35, Steve Eynon <st...@alienfactory.co.uk>
> wrote:
> > I found you also need to put the
> >
> > @SupportsInformalParameters
> >
> > on your component. See the RenderInformals mixin for an example (or
> > just use the RenderInformals mixin!)
> >
> > Steve.
> >
> >
> >
> >
> > On 10 November 2011 06:22, Michael Prescott
> > <mi...@gmail.com> wrote:
> >> That didn't seem to make a difference, but it sounds prudent.
> >>
> >> On 9 November 2011 17:09, Lenny Primak <lp...@hope.nyc.ny.us> wrote:
> >>
> >>> AfterRender, not afterRenderBody and beginRender and it should work.
> >>>
> >>>
> >>>
> >>> On Nov 9, 2011, at 4:58 PM, Michael Prescott <
> michael.r.prescott@gmail.com>
> >>> wrote:
> >>>
> >>> > I had tried those instructions, but I guess I was a bit too rote (not
> >>> being
> >>> > familiar with these events, most of my components have templates); I
> need
> >>> > to close the element in afterRenderBody().  Thanks for the
> encouragement
> >>> to
> >>> > continue puzzling it out.
> >>> >
> >>> > Michael
> >>> >
> >>> > On 9 November 2011 16:28, Lenny Primak <lp...@hope.nyc.ny.us>
> wrote:
> >>> >
> >>> >> You have to have beginRender/afterRender(MarkupWriter) methods
> >>> >> in your page, and then write the root element in them, and then it
> >>> should
> >>> >> work.
> >>> >> I followed the InformalParameter documentation page and it worked.
> >>> >>
> >>> >> On Nov 9, 2011, at 4:25 PM, Michael Prescott wrote:
> >>> >>
> >>> >>> How do you render informal parameters if your component has a
> template
> >>> >>> file?  I've tried using the RenderInformals mixin, but (somewhat
> >>> >> bizarrely)
> >>> >>> it puts the informal parameters on the parent element!
> >>> >>
> >>> >>
> >>> >>
> ---------------------------------------------------------------------
> >>> >> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>> >> For additional commands, e-mail: users-help@tapestry.apache.org
> >>> >>
> >>> >>
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>
> >>>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Rendering Informal Parameters

Posted by Steve Eynon <st...@alienfactory.co.uk>.
'hang on - I just re-read your question...

Are you wanting to specifiy on where in your .tml the informals are rendered?

If so, the call to :

    resources.renderInformalParameters(writer);

renders them on the current element. (The RenderInformals Mixin calls
it on the beginRender() phase event hence the informals are writen to
the root element.) You probably want something like this (untested,
obviously! But worth a try):

<div class="render informals here">
    <t:trigger event="renderInformals"/>
</div>

void onRenderInformals() {
    resources.renderInformalParameters(writer);
}

Steve.



On 11 November 2011 11:35, Steve Eynon <st...@alienfactory.co.uk> wrote:
> I found you also need to put the
>
> @SupportsInformalParameters
>
> on your component. See the RenderInformals mixin for an example (or
> just use the RenderInformals mixin!)
>
> Steve.
>
>
>
>
> On 10 November 2011 06:22, Michael Prescott
> <mi...@gmail.com> wrote:
>> That didn't seem to make a difference, but it sounds prudent.
>>
>> On 9 November 2011 17:09, Lenny Primak <lp...@hope.nyc.ny.us> wrote:
>>
>>> AfterRender, not afterRenderBody and beginRender and it should work.
>>>
>>>
>>>
>>> On Nov 9, 2011, at 4:58 PM, Michael Prescott <mi...@gmail.com>
>>> wrote:
>>>
>>> > I had tried those instructions, but I guess I was a bit too rote (not
>>> being
>>> > familiar with these events, most of my components have templates); I need
>>> > to close the element in afterRenderBody().  Thanks for the encouragement
>>> to
>>> > continue puzzling it out.
>>> >
>>> > Michael
>>> >
>>> > On 9 November 2011 16:28, Lenny Primak <lp...@hope.nyc.ny.us> wrote:
>>> >
>>> >> You have to have beginRender/afterRender(MarkupWriter) methods
>>> >> in your page, and then write the root element in them, and then it
>>> should
>>> >> work.
>>> >> I followed the InformalParameter documentation page and it worked.
>>> >>
>>> >> On Nov 9, 2011, at 4:25 PM, Michael Prescott wrote:
>>> >>
>>> >>> How do you render informal parameters if your component has a template
>>> >>> file?  I've tried using the RenderInformals mixin, but (somewhat
>>> >> bizarrely)
>>> >>> it puts the informal parameters on the parent element!
>>> >>
>>> >>
>>> >> ---------------------------------------------------------------------
>>> >> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> >> For additional commands, e-mail: users-help@tapestry.apache.org
>>> >>
>>> >>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Rendering Informal Parameters

Posted by Steve Eynon <st...@alienfactory.co.uk>.
I found you also need to put the

@SupportsInformalParameters

on your component. See the RenderInformals mixin for an example (or
just use the RenderInformals mixin!)

Steve.




On 10 November 2011 06:22, Michael Prescott
<mi...@gmail.com> wrote:
> That didn't seem to make a difference, but it sounds prudent.
>
> On 9 November 2011 17:09, Lenny Primak <lp...@hope.nyc.ny.us> wrote:
>
>> AfterRender, not afterRenderBody and beginRender and it should work.
>>
>>
>>
>> On Nov 9, 2011, at 4:58 PM, Michael Prescott <mi...@gmail.com>
>> wrote:
>>
>> > I had tried those instructions, but I guess I was a bit too rote (not
>> being
>> > familiar with these events, most of my components have templates); I need
>> > to close the element in afterRenderBody().  Thanks for the encouragement
>> to
>> > continue puzzling it out.
>> >
>> > Michael
>> >
>> > On 9 November 2011 16:28, Lenny Primak <lp...@hope.nyc.ny.us> wrote:
>> >
>> >> You have to have beginRender/afterRender(MarkupWriter) methods
>> >> in your page, and then write the root element in them, and then it
>> should
>> >> work.
>> >> I followed the InformalParameter documentation page and it worked.
>> >>
>> >> On Nov 9, 2011, at 4:25 PM, Michael Prescott wrote:
>> >>
>> >>> How do you render informal parameters if your component has a template
>> >>> file?  I've tried using the RenderInformals mixin, but (somewhat
>> >> bizarrely)
>> >>> it puts the informal parameters on the parent element!
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> >> For additional commands, e-mail: users-help@tapestry.apache.org
>> >>
>> >>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Rendering Informal Parameters

Posted by Michael Prescott <mi...@gmail.com>.
That didn't seem to make a difference, but it sounds prudent.

On 9 November 2011 17:09, Lenny Primak <lp...@hope.nyc.ny.us> wrote:

> AfterRender, not afterRenderBody and beginRender and it should work.
>
>
>
> On Nov 9, 2011, at 4:58 PM, Michael Prescott <mi...@gmail.com>
> wrote:
>
> > I had tried those instructions, but I guess I was a bit too rote (not
> being
> > familiar with these events, most of my components have templates); I need
> > to close the element in afterRenderBody().  Thanks for the encouragement
> to
> > continue puzzling it out.
> >
> > Michael
> >
> > On 9 November 2011 16:28, Lenny Primak <lp...@hope.nyc.ny.us> wrote:
> >
> >> You have to have beginRender/afterRender(MarkupWriter) methods
> >> in your page, and then write the root element in them, and then it
> should
> >> work.
> >> I followed the InformalParameter documentation page and it worked.
> >>
> >> On Nov 9, 2011, at 4:25 PM, Michael Prescott wrote:
> >>
> >>> How do you render informal parameters if your component has a template
> >>> file?  I've tried using the RenderInformals mixin, but (somewhat
> >> bizarrely)
> >>> it puts the informal parameters on the parent element!
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >> For additional commands, e-mail: users-help@tapestry.apache.org
> >>
> >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Rendering Informal Parameters

Posted by Lenny Primak <lp...@hope.nyc.ny.us>.
AfterRender, not afterRenderBody and beginRender and it should work. 



On Nov 9, 2011, at 4:58 PM, Michael Prescott <mi...@gmail.com> wrote:

> I had tried those instructions, but I guess I was a bit too rote (not being
> familiar with these events, most of my components have templates); I need
> to close the element in afterRenderBody().  Thanks for the encouragement to
> continue puzzling it out.
> 
> Michael
> 
> On 9 November 2011 16:28, Lenny Primak <lp...@hope.nyc.ny.us> wrote:
> 
>> You have to have beginRender/afterRender(MarkupWriter) methods
>> in your page, and then write the root element in them, and then it should
>> work.
>> I followed the InformalParameter documentation page and it worked.
>> 
>> On Nov 9, 2011, at 4:25 PM, Michael Prescott wrote:
>> 
>>> How do you render informal parameters if your component has a template
>>> file?  I've tried using the RenderInformals mixin, but (somewhat
>> bizarrely)
>>> it puts the informal parameters on the parent element!
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>> 
>> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Rendering Informal Parameters

Posted by Michael Prescott <mi...@gmail.com>.
I had tried those instructions, but I guess I was a bit too rote (not being
familiar with these events, most of my components have templates); I need
to close the element in afterRenderBody().  Thanks for the encouragement to
continue puzzling it out.

Michael

On 9 November 2011 16:28, Lenny Primak <lp...@hope.nyc.ny.us> wrote:

> You have to have beginRender/afterRender(MarkupWriter) methods
> in your page, and then write the root element in them, and then it should
> work.
> I followed the InformalParameter documentation page and it worked.
>
> On Nov 9, 2011, at 4:25 PM, Michael Prescott wrote:
>
> > How do you render informal parameters if your component has a template
> > file?  I've tried using the RenderInformals mixin, but (somewhat
> bizarrely)
> > it puts the informal parameters on the parent element!
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Rendering Informal Parameters

Posted by Lenny Primak <lp...@hope.nyc.ny.us>.
You have to have beginRender/afterRender(MarkupWriter) methods
in your page, and then write the root element in them, and then it should work.
I followed the InformalParameter documentation page and it worked.

On Nov 9, 2011, at 4:25 PM, Michael Prescott wrote:

> How do you render informal parameters if your component has a template
> file?  I've tried using the RenderInformals mixin, but (somewhat bizarrely)
> it puts the informal parameters on the parent element!


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org