You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Jesse Kuhnert (JIRA)" <ta...@jakarta.apache.org> on 2006/07/23 17:12:14 UTC

[jira] Resolved: (TAPESTRY-735) SubmitScript component

     [ http://issues.apache.org/jira/browse/TAPESTRY-735?page=all ]

Jesse Kuhnert resolved TAPESTRY-735.
------------------------------------

    Fix Version/s: 4.1
       Resolution: Fixed

The new EventListener annotation should be able to handle this.

> SubmitScript component
> ----------------------
>
>                 Key: TAPESTRY-735
>                 URL: http://issues.apache.org/jira/browse/TAPESTRY-735
>             Project: Tapestry
>          Issue Type: New Feature
>          Components: Framework
>    Affects Versions: 4.0
>         Environment: Tapestry 4.0-beta-12
>            Reporter: Leonardo Quijano Vincenzi
>             Fix For: 4.1
>
>
> I implemented a SubmitScript component that works in a similar way to LinkSubmit. The only difference is that it doesn't render any links, just the JavaScript function that submits a form and calls a listener
> It can be used on a page, like this:
> <span jwcid="changeName@SubmitScript" action="listener:changeName" />
> And on the field...
> <input jwcid="name@TextField" 
>            onchange="ognl:components.changeName.href" />
> It only generates a JavaScript in the BODY component, like this:
> function changeName_id() {
>   var form = Tapestry.find('Form');
>   
>   if (form.events.onsubmit_handler()) {
>     Tapestry.find('changeName').value = "T";
>     form.onsubmit = null;
>     form.submit();
>   }
> }
> And it'll call a listener in the component:
> public void changeName(IRequestCycle cycle) {
>    .. // do something
> }
> This is mostly the functionality of Link, but far more flexible. I'm using it to attach listeners to 'onchange' and 'onclick' javascript events, and it could also be used to provide form submission to @DirectLink or @PageLink (LinkSubmit would get deprecated by this).
> This is already implemented, but it still has some app-specific stuff. If people are interested I can remove those things and submit it here.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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