I am unable to apply both element and ajax decorations as follows...(There is a JIRA for this...SWF-804)
Looking for a work-around to use spring Ajax with dojo button widget.
This does not work:
If I remove the element decoration the AJAX decoration call works and correct fragment is rendered (as defined in the flow).Code:<button type="submit" id="refreshButton" name="_eventId_refresh"> <img src="<core:url value="/resources/images/icons/refresh.gif"/>"/> </button> <script type="text/javascript"> Spring.addDecoration(new Spring.ElementDecoration({ elementId : "refreshButton", widgetType : "dijit.form.Button" })); Spring.addDecoration(new Spring.AjaxEventDecoration({ elementId : "refresh", event : "onclick", eventId : "refresh", formId : "refreshForm" })); </script>
Now how to get both dojo button widget and AJAX to work?
Any ideas? The following works when first rendered but after the tile is rendered the button loses the dojo widget decoration.
Code:<script type="text/javascript"> dojo.require("dijit.form.Button"); </script> <button dojotype="dijit.form.Button" type="submit" id="refreshDasStatusButton" name="_eventId_refreshDasStatus" style="float:right" onclick="alert('ajax'); Spring.remoting.submitForm('refreshDasStatusButton', 'refreshStatusForm', {_eventId:'refreshDasStatus'}, {fragment:'dasStatus'}); return false;"> <img src="<core:url value="/resources/images/icons/refresh.gif"/>" alt="Refresh" /> </button>


Reply With Quote
