Hi all,
I'm trying to use dojo.xhrPost to submit a form on the radio button click event and I'm expecting the flow controller to return the next page in the flow in the specified div... however it doesn't seem to be working. It just returns the page I had just submitted... it seems like either the xhrPost isn't sending the form along with it... or swf isn't recognizing that it's there.
Anyone know how to do something like this??
Thanks,
Mike
Here's the code:
Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <%@ include file="/WEB-INF/jsp/common/taglibs.jsp"%> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title></title> <%@ include file="/WEB-INF/jsp/common/electionStyles.jsp"%> <script src="/shares/scripts/js/dojo/dojo.js" type="text/javascript"></script> <script type="text/javascript"> function init(){ myForm = dojo.byId('form'); submitEvent = dojo.connect(myForm, 'submit', 'handleSubmit'); } </script> <script type="text/javascript"> function handleSubmit(evt) { dojo.stopEvent(evt); dojo.xhrPost( { url: myForm.action, handleAs: "text", load: function(response){ dojo.byId('myDiv').innerHTML = response; return response; }, form: "form", error: function(response, ioArgs) { console.error("HTTP status code: ", ioArgs.xhr.status); return response; } }); } </script> <script type="text/javascript"> dojo.addOnLoad(init); </script> </head> <body> <form:form commandName="form" method="post"> <input type="hidden" name="_flowExecutionKey" value="${flowExecutionKey}" /> <form:errors path="*" cssClass="errorText" /> <div id="mainDiv"> <table> <tr> <th>Select Subscription Details</th> </tr> <tr> <td>Account Type</td> <td> <c:forEach items="${customAccountTypes}" var="accountType"> <p class="indent data"> <spring:bind path="confirmationDetails.customAccountType"> <input type="radio" name="confirmationDetails.customAccountType" value="${accountType.id}" onclick="document.getElementById('next').click();" <c:if test='${accountType == status.value}'>checked="checked"</c:if> /> <c:out value="${accountType.name}"></c:out> </spring:bind> </p> </c:forEach> </td> </tr> </table> </div> <div id="myDiv"> </div> <input id="next" type="submit" name="_eventId_next" value="Next" style="visibility:hidden"/> </form:form> </body> </html>


Reply With Quote
