Skip to content

AJAXParent.js

Paul L. Cimino edited this page Nov 15, 2013 · 4 revisions

AJAXParent.js

Parent Kind for all AJAX Kinds. Most child Kinds simply define the REST API, some override the processResponse() and processError(), as necessary.

Here's an example of use:

  • LoginPage.js: mvcApp.waterfall('onLogin', {username: owner.$.username.value, password: owner.$.password.value});
  • PublicController.js: login: function(inSender, inEvent) { var ajaxLogin = new AJAX.Login({owner:this, fireEvent:'onLoginResult'}); ajaxLogin.makeRequest({username:inEvent.username , password:inEvent.password}); } PublicController.js: loginResult: function(inSender, inEvent) { if (inEvent.authenticated) { mvcApp.data.user = inEvent.userdata; mvcApp.username = mvcApp.data.username; mvcApp.data.username = ''; mvcApp.data.password = ''; // display the authenticated home page mvcApp.setAuthView(); } else { mvcApp.showWarningMessage("Login failed", inEvent.message); }; }

#../

\enyo-mvc-web-app
      |
      +---index html
      +---mvcApp html
      +---mvcAppDebug html
      +---package json
      +---node-server js
      +---mvcApp html
      +---assets
      +---enyo
      +---lib
      +---node_modules
      +---public
      +---scripts
      |
      \---source
            |
            +---apps
            +---controllers
            |     |
            |     +---auth
            |     \---public
            |
            +---css
            +---ext
            +---models
            |     |
            |     +---ajax
            |     \---socket
            |
            \---views
               |
               +---auth
               |     |
               |     \---body
               |
               \---public
                  |
                  \---body

Purpose

Project Background

Quick Start

Quick Start

Tutorial Walk Through

Add a Contact Page for Authorized users

Project Architecture

Application Architecture

Architectural Decisions

Why is the project structured this way?

Implementation Decisions

Why are some things implemented this way?

Known Issues

Package Layout & Code Inheritance

Home

Home

Clone this wiki locally