On Thu, 01 Apr 2010 02:25:48 -0300, LiborGMC <l.pre...@gmc.net> wrote:
I've tried use Opera debugger just make sure that JS code with submit
form is called. Yes it is.
I've tested your code in Opera 10.10 in Linux and it worked perfectly. I
just added a link to submit the:
<a href="#" id="link"
onclick="document.getElementById('paTableForm').submit()">Submit</a>
I haven't used JavaScript the right (using a listener instead of onclick)
way because I wanted to do a test in a short time.
By the way, there's a LinkSubmit component in Tapestry.
Java page:
@IncludeJavaScriptLibrary("context:js/index.js")
public class Index {
@Inject
private ComponentResources resources;
@Property
@Persist
private String name;
@Property
@Persist
private String result;
public Object onSubmitFromPaTableForm(){
return getCurrentPageName();
}
If you want this page to be rendered, return void or null. In you above
method, you're forcing a redirect that is not needed.
@OnEvent(component="handleAction")
public Object handleAction(){
System.out.println( name);
result = name;
return getCurrentPageName();
}
This method is never invoked because there isn't a handleAction component.
Thus, the result field is never updated.
This code works for me on Firefox 3 and IE8. It doesn't work on Safari 4,
Opera 9.64.
What do you mean by this code doesn't work?
--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da
Informação Ltda.
http://www.arsmachina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org