Changeset 264 for Dev/branches


Ignore:
Timestamp:
02/16/12 15:00:23 (13 years ago)
Author:
hendrikvanantwerpen
Message:
  • [Client] Added comments on content handling, added leave blocking on test3 and minor bugfix in hash if leaving is blocked.
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  
    7474        });
    7575    </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>
    7780    <div data-dojo-type="dijit.layout.TabContainer" data-dojo-props="doLayout: false">
    7881        <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 */
    121define(['dojo/_base/declare','dojo/_base/connect','dojo/_base/xhr',
    222    'dojo/_base/lang','dojo/_base/Deferred','dojo/hash',
     
    6787                if ( currentPage ) {
    6888                    if ( currentPage.onLeave() === false ) {
     89                        // restore hash if changed by hand or back button
     90                        hash(currentHash);
    6991                        dfd.reject();
    7092                        return dfd.promise;
Note: See TracChangeset for help on using the changeset viewer.