tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leonardo Quijano Vincenzi (JIRA)" <tapestry-...@jakarta.apache.org>
Subject [jira] Created: (TAPESTRY-735) SubmitScript component
Date Wed, 02 Nov 2005 05:38:55 GMT
SubmitScript component

         Key: TAPESTRY-735
         URL: http://issues.apache.org/jira/browse/TAPESTRY-735
     Project: Tapestry
        Type: New Feature
  Components: Framework  
    Versions: 4.0    
 Environment: Tapestry 4.0-beta-12
    Reporter: Leonardo Quijano Vincenzi

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;

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:
For more information on JIRA, see:

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

View raw message