Changes between Version 6 and Version 7 of AJAX/Dojo/RefactoredFormSubmit
- Timestamp:
- Feb 11, 2007, 10:34:30 AM (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AJAX/Dojo/RefactoredFormSubmit
v6 v7 1 1 2 === Introduction === 2 3 3 4 Here's a simple recipe that worked for me. It is quite inspired by the [wiki:AjaxDojoFormSub] example―and from [http://www.b-list.org/weblog/2006/07/31/django-tips-simple-ajax-example-part-1 this tutorial]―except that this recipe is expected to use python-cjson for receiving JSON data. … … 5 6 My initial objective was to display validation errors without doing a page-refresh, by using JSON 6 7 for carrying errors (or whatever else you could possibly imagine) back to the client browser. 8 9 === The server view === 7 10 8 11 First thing first, lets write the server view, as its really important to make the forms working … … 30 33 }}} 31 34 35 === The client view === 32 36 33 We could tryto arrange the client code to fit into one, unportable template chunk, however it's37 Now that the server view is writtent, we could try next to arrange the client code to fit into one, unportable template chunk, however it's 34 38 usually best to split the work in smaller pieces, at least for being nice to the maintainers (You). :-) 35 39 36 So let's move on in writing our own Dojo template, where we will make an abstraction of all our applied 37 Dojo concepts. 40 So let's move on in writing our own Dojo template, where we will make an abstraction of all our applied Dojo concepts. 38 41 39 42 Quite frankly, that part is going straight-forward, as we're only writing HTML: 40 43 {{{ 44 #!text/html 41 45 <script type="text/javascript"> 42 46 djConfig = {