You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Rendy Tapestry <re...@gmail.com> on 2011/10/02 17:48:34 UTC

Custom component

Hi All,

Is it possible to have a custom component with a method that will getting
called when the enclosing form is being submitted ? In that method, I want
to change some parameter of that custom component.

Thanks,
Rendy.

Re: Custom component

Posted by Giulio Micali <gi...@gmail.com>.
yes, the second is better If your component is a "container" for a group of
fields.
In that case, you should do it in the afterRender phase, so your method is
called after all single fields has already the new submitted values and you
can "validate" (and rollback if you want) the whole result.


2011/10/3 Rendy Tapestry <re...@gmail.com>

> Thanks Taha,
>
> I'll give your second suggestion a try.
>
> Thanks,
> Rendy.
>
> On Sun, Oct 2, 2011 at 11:03 PM, Taha Hafeez Siddiqi <
> tawus.tapestry@gmail.com> wrote:
>
> > Hi Rendy
> >
> > Your component, if fits the definition of a form field, can extend
> > AbstractField and then override processSubmission() method.
> >
> > Otherwise you can @Inject FormSupport and then use
> > FormSupport#storeAndExecute() to execute a ComponentAction
> >
> > regards
> > Taha
> >
> > On Oct 2, 2011, at 9:18 PM, Rendy Tapestry wrote:
> >
> > > Hi All,
> > >
> > > Is it possible to have a custom component with a method that will
> getting
> > > called when the enclosing form is being submitted ? In that method, I
> > want
> > > to change some parameter of that custom component.
> > >
> > > Thanks,
> > > Rendy.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>

Re: Custom component

Posted by Rendy Tapestry <re...@gmail.com>.
Thanks Taha,

I'll give your second suggestion a try.

Thanks,
Rendy.

On Sun, Oct 2, 2011 at 11:03 PM, Taha Hafeez Siddiqi <
tawus.tapestry@gmail.com> wrote:

> Hi Rendy
>
> Your component, if fits the definition of a form field, can extend
> AbstractField and then override processSubmission() method.
>
> Otherwise you can @Inject FormSupport and then use
> FormSupport#storeAndExecute() to execute a ComponentAction
>
> regards
> Taha
>
> On Oct 2, 2011, at 9:18 PM, Rendy Tapestry wrote:
>
> > Hi All,
> >
> > Is it possible to have a custom component with a method that will getting
> > called when the enclosing form is being submitted ? In that method, I
> want
> > to change some parameter of that custom component.
> >
> > Thanks,
> > Rendy.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Custom component

Posted by Taha Hafeez Siddiqi <ta...@gmail.com>.
Hi Rendy

Your component, if fits the definition of a form field, can extend AbstractField and then override processSubmission() method.

Otherwise you can @Inject FormSupport and then use FormSupport#storeAndExecute() to execute a ComponentAction

regards
Taha
 
On Oct 2, 2011, at 9:18 PM, Rendy Tapestry wrote:

> Hi All,
> 
> Is it possible to have a custom component with a method that will getting
> called when the enclosing form is being submitted ? In that method, I want
> to change some parameter of that custom component.
> 
> Thanks,
> Rendy.


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