You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Chris Norris <CN...@widen.com> on 2003/11/06 18:50:20 UTC
AbstractFormComponent with a template
First, my base assumption:
We are making a component that needs to know when the form it is in is
rewinding. So we have a .jwc file and a java file. The java file extends
AbstractFormComponent so that we can override renderComponent and use the
form.isRewinding() to know when it is rewinding. So my assumption here is
that to know when a component's containing form is rewinding, we should
extend AbstractFormComponent and override renderComponent. Is that correct?
So this is what I need to know:
Is it possible for this component to have a template? Or do I have to
manually construct the html in the renderComponent method? Is there some
method I can call within renderComponent that will use a template to make
the component? I've been browsing the API but can't find anything.
Thanks,
Chris
Re: AbstractFormComponent with a template
Posted by Harish Krishnaswamy <hk...@comcast.net>.
Do you have mutiple forms in the page? If not you can extend BaseComponent and use
IRequestCycle.isRewinding(). The general rule of thumb is you extend BaseComponent if your new
component is going to have a template and you extend AbstractCompoent if your new component doesn't
have one. Tapestry form components do not have templates so they extend AbstractComponent. If you
have to extend AbstractFormComponent, then you have to generate the html in your java. Hope this
answers your question.
-Harish
Chris Norris wrote:
> First, my base assumption:
> We are making a component that needs to know when the form it is in is
> rewinding. So we have a .jwc file and a java file. The java file extends
> AbstractFormComponent so that we can override renderComponent and use the
> form.isRewinding() to know when it is rewinding. So my assumption here is
> that to know when a component's containing form is rewinding, we should
> extend AbstractFormComponent and override renderComponent. Is that correct?
>
> So this is what I need to know:
> Is it possible for this component to have a template? Or do I have to
> manually construct the html in the renderComponent method? Is there some
> method I can call within renderComponent that will use a template to make
> the component? I've been browsing the API but can't find anything.
>
> Thanks,
> Chris
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org