Forget the question, I tested it myself and it works :)

See the blog post for the complete working solution, that enables any
element to submit the form and trigger an event, like a regular submit.

http://tinybits.blogspot.com/2010/05/mixin-to-allow-any-element-to-submit.html

On Fri, May 21, 2010 at 9:29 AM, Inge Solvoll <inge.tapes...@gmail.com>wrote:

> After looking at the source code for the LinkSubmit core component, I see a
> lot of potential for a more generic component/mixin that could solve lots of
> other problems.
>
> What I need right now (and quite often) is a Select component that submits
> the form and triggers an event to let the component class know that it was
> the source of the submit. The LinkSubmit source code is very close to doing
> this, the only difference is that it insists on rendering a link.
>
> My questions is:
>
> Is it possible to encapsulate this in a mixin, named something like
> "AnySubmit"? It would only need parameters for "event" and "clientEvent".
>
> I tried, but I don't see how I can use a mixin and still trigger an event
> on submit using ComponentAction. See modified code from LinkSubmit below, is
> this possible to do in a mixin on any component?
>
> private static class ProcessSubmission implements
> ComponentAction<MySubmitMixinClass> {
>
>     private final String clientId;
>
>     public ProcessSubmission(String clientId) {
>       this.clientId = clientId;
>     }
>
>     public void execute(MySubmitMixinClass component) {
>       component.processSubmission(clientId);
>     }
>   }
>

Reply via email to