Thanks for the response.
I tried what you described. The functionality works. But, even though the
event handler function of the submit button bookTrade returns other some
page, I have an impression that it is an ajax form submit. This is because
on using the object Request defined in the java file, i see that the
.isXHR() returns always true.
What I want is that the bookTrade button should submit the page normally,
and there should not be any ajax animations.
--
Page in TML
--
div t:type=zone t:id=formZone
form class=creationForm t:zone=formZone t:type=form
t:id=orderClaculateValue method=postt:errors /
input t:type=textfield t:id=price t:value=price/
input t:type=textfield t:id=quantity t:value=quantity /
input t:type=textfield t:id=amount t:value=amount t:size=5/
input t:type=textfield t:id=counterparty t:value=counterparty /
.
.
input t:type=Submit t:id=calculate value=Calculate/
.
.
input t:id=bookTrade value=Finalise t:type=submit/
/form
/div
.java
@InjectPage
private OrderFinalise orderFinalisePage;
@Component
private Submit calculate;
@Component
private Submit bookTrade;
@Component(id=formZone)
private Zone formZone;
@Inject
private Request request;
void onSelectedFromBookTrade() {
formEventReturn = orderFinalisePage; // go to AnotherPage
}
void onSelectedFromCalculate() {
amount = quantity * price;
formEventReturn = formZone.getBody(); // stay on this page
}
Object onSuccessFromOrderClaculateValue() {
//if(request.isXHR())
//{
// return formZone.getBody(); // AJAX request, return zone body
//}
//else
//{
// return orderFinalisePage; // non-AJAX request, redraw current
page
//}
return formEventReturn;
}
--
--
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/Multiple-Submits-and-Ajax-Form-tp5713699p5713767.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org