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="[EMAIL PROTECTED]" action="listener:changeName" />
And on the field...
<input jwcid="[EMAIL PROTECTED]"
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]