Announcement Announcement Module
Collapse
No announcement yet.
Form submit via AjaxEventDecoration breaks due to undefined href on button Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Form submit via AjaxEventDecoration breaks due to undefined href on button

    I have a form that I would like to submit via AJAX using Spring.AjaxEventDecoration on a button. When I click on the button, the entire page refreshes, and I get a dojo error in the Firebug console saying that "ioArgs.url is undefined". Turns out that when Spring tries to submit the form upon button click, it uses dojo.byId("buttonId").href as the url. Can someone please point out what I am missing?

    I am using spring-js 2.3.1.RELEASE.

    JSP:
    HTML Code:
    <input type="submit" id="copyBtn" value="Finish" />
    The form submitted is rendered in a Dojo Dialog pop-up, and the content in the pop-up is defined as a Tile. I expect the page not to do a full page submit when I click on the button, the form to be posted to the server, and the pop-up to be re-rendered with the response.

    Javascript:
    Code:
    	Spring.addDecoration(new Spring.AjaxEventDecoration({
    		   elementId: "copyBtn",
    		   popup:true,
    		   event: "onclick",
    		   params: {fragments: "createDialog", mode:"embedded"}
    		}));
    Last edited by citress; Jul 2nd, 2012, 11:40 AM. Reason: Added spring-js version
Working...
X