Changeset 264
- Timestamp:
- 02/16/12 15:00:23 (13 years ago)
- Location:
- Dev/branches/rest-dojo-ui/client
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/branches/rest-dojo-ui/client/pages/test3.html
r263 r264 74 74 }); 75 75 </script> 76 <h1>Embedded scripts</h1> 76 <script type="rft/method" data-rft-method="onLeave"> 77 return false; 78 </script> 79 <h1>Embedded scripts (leave is blocked)</h1> 77 80 <div data-dojo-type="dijit.layout.TabContainer" data-dojo-props="doLayout: false"> 78 81 <div data-dojo-type="dijit.layout.ContentPane" title="Sessions"> -
Dev/branches/rest-dojo-ui/client/rft/content.js
r263 r264 1 /** rft/ui/content - Load page content 2 * 3 * The rft/ui/content module is responsible for loading content in the app. 4 * Content is loaded by calling: 5 * content.goTo('pageId'); 6 * The page is then loaded from pages/pageId.html. This should contain one top node. 7 * This top node gets a _Page widget instantiated on it. The template should not 8 * specify another widget on the topnode. A page controller can be specified by 9 * the data-rft-mixin attribute to a class inherited from _PageController. 10 * You can also specify methods in the template in script tags as: 11 * <script type="rft/method" data-rft-method-name="onVisit|onLeave"> 12 * // code 13 * </script> 14 * The two relevant events are onVisit and onLeave. After loading and starting 15 * the complete page onVisit is called. Use this to link widgets together and 16 * load any dynamic content not handled by widget logic already. 17 * The event onLeave is called before navigating to another page. If false is 18 * returned from this function, the navigation will be cancelled. You can use 19 * this e.g. to ask confirmation of changed values are not saved. 20 */ 1 21 define(['dojo/_base/declare','dojo/_base/connect','dojo/_base/xhr', 2 22 'dojo/_base/lang','dojo/_base/Deferred','dojo/hash', … … 67 87 if ( currentPage ) { 68 88 if ( currentPage.onLeave() === false ) { 89 // restore hash if changed by hand or back button 90 hash(currentHash); 69 91 dfd.reject(); 70 92 return dfd.promise;
Note: See TracChangeset
for help on using the changeset viewer.