独自のJavaScriptを呼び出す

自分で作ったJavaScriptをSubmit時に呼び出したいのですが、どうするのが一番スマートですか?*1

renderComponent時に、イベントハンドラを追加しましょう。

protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle){
    ...
    yourFormComponent.addEventHandler(FormEventType.SUBMIT, "javaScriptValidatingFunctionName");
    ...
}

org.apache.tapestry.contrib.palette.Paletteをみてみると詳しいことがわかります。

*1:http://jakarta.apache.org/tapestry/faq.htmlの2.10 "I'd like to be able attach my own client-side javascript handling on the form submit. What's the best way to do this?"より