PRADO v3.1.3 Quickstart Tutorial
290 pages
English

PRADO v3.1.3 Quickstart Tutorial

Le téléchargement nécessite un accès à la bibliothèque YouScribe
Tout savoir sur nos offres
290 pages
English
Le téléchargement nécessite un accès à la bibliothèque YouScribe
Tout savoir sur nos offres

Description

PRADO v3.1.3 Quickstart
1Tutorial
Qiang Xue and Wei Zhuo
November 1, 2008
1Copyright 2004-2008. All Rights Reserved. Contents
Contents i
Preface xvii
License xix
1 Getting Started 1
1.1 Welcome to the PRADO Quickstart Tutorial . . . . . . . . . . . . . . . . . . . . . 1
1.1.1 How PRADO Works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1.2 Examples and Demos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.1.3 Tutorials and Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 What is PRADO? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2.1 Why PRADO? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2.2 What Is PRADO Best For? . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2.3 How Is PRADO Compared with Other Frameworks? . . . . . . . . . . . . . 5
1.2.4 Is PRADO Stable Enough? . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.2.5 History of PRADO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.3 Installing PRADO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
i 1.4 New Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.4.1 Version 3.1.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.4.2 Version 3.1.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.4.3 Version 3.1.1 . . . . . . . . . . . . . . . . . . . . . ...

Sujets

Informations

Publié par
Nombre de lectures 67
Langue English
Poids de l'ouvrage 1 Mo

Extrait

PRADO v3.1.3 Quickstart 1Tutorial Qiang Xue and Wei Zhuo November 1, 2008 1Copyright 2004-2008. All Rights Reserved. Contents Contents i Preface xvii License xix 1 Getting Started 1 1.1 Welcome to the PRADO Quickstart Tutorial . . . . . . . . . . . . . . . . . . . . . 1 1.1.1 How PRADO Works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1.2 Examples and Demos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.1.3 Tutorials and Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.2 What is PRADO? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.2.1 Why PRADO? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.2.2 What Is PRADO Best For? . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.2.3 How Is PRADO Compared with Other Frameworks? . . . . . . . . . . . . . 5 1.2.4 Is PRADO Stable Enough? . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 1.2.5 History of PRADO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 1.3 Installing PRADO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 i 1.4 New Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.4.1 Version 3.1.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.4.2 Version 3.1.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.4.3 Version 3.1.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.4.4 Version 3.1.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.5 Upgrading from v2.x and v1.x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.5.1 Component De nition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 1.5.2 Application Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 1.5.3 Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 1.5.4 Control Relationship . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 1.5.5 Template Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 1.5.6 Theme Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2 Tutorials 13 2.1 My First PRADO Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 2.2 Sample: Hangman Game . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 2.3 Command Line Tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 2.3.1 Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 2.3.2 Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 2.3.3 Creating a new Prado project skeleton . . . . . . . . . . . . . . . . . . . . . 17 2.3.4 Interactive Shell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 3 Tutorial: Currency Converter 21 3.1 Building a Simple Currency Converter . . . . . . . . . . . . . . . . . . . . . . . . . 21 ii 3.2 Downloading and Installing Prado . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 3.3 Creating a new Prado web Application . . . . . . . . . . . . . . . . . . . . . . . . . 22 3.4 Creating the Currency Converter User Interface . . . . . . . . . . . . . . . . . . . . 22 3.5 Implementing Currency Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 3.6 Adding Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 3.7 Improve User Experience With Active Controls . . . . . . . . . . . . . . . . . . . . 27 3.8 Adding Final Touches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 4 Tutorial: Building an AJAX Chat Application 31 4.1 Building an AJAX Chat Application . . . . . . . . . . . . . . . . . . . . . . . . . . 31 4.2 Download, Install and Create a New Application . . . . . . . . . . . . . . . . . . . 32 4.3 Authentication and Authorization . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 4.3.1 Securing the Home page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 4.4 Active Record for chat users table . . . . . . . . . . . . . . . . . . . . . . . . . . 35 4.4.1 Custom User Manager class . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 4.5 Authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 4.5.1 Default Values for ActiveRecord . . . . . . . . . . . . . . . . . . . . . . . . 39 4.6 Main Chat Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 4.6.1 Exploring the Active Controls . . . . . . . . . . . . . . . . . . . . . . . . . . 42 4.7 Active Record for chat buffer table . . . . . . . . . . . . . . . . . . . . . . . . . . 43 4.8 Chat Application Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 4.9 Putting It Together . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 4.10 Improving User Experience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 iii 5 Tutorial: Addressbook 51 5.1 A Simple Address Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 6 Fundamentals 53 6.1 Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 6.2 Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 6.2.1 Component Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 6.2.2 Component Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 6.2.3 Namespaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 6.2.4 Component Instantiation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 6.3 Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 6.3.1 Control Tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 6.3.2 Control Identi cation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 6.3.3 Naming Containers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 6.3.4 ViewState and ControlState . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 6.4 Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 6.4.1 PostBack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 6.4.2 Page Lifecycles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 6.5 Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 6.5.1 Request Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 6.5.2 Response Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 6.5.3 Session Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 6.5.4 Error Handler Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 6.5.5 Custom Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 iv 6.6 Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 6.6.1 Page Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 6.7 Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 6.7.1 Directory Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 6.7.2 Application Deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 6.7.3 Lifecycles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 7 Con gurations 69 7.1 Con guration Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 7.2 Templates: Part I . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 7.2.1 Component Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 7.2.2 Template Control Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 7.2.3 Comment Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 7.2.4 Include Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 7.3 Templates: Part II . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 7.3.1 Dynamic Content Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 7.4 Templates: Part III . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 7.4.1 Dynamic Property Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 7.5 Application Con gurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 7.6 Page Con gurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 7.7 URL Mapping (Friendly URLs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 7.7.1 Specifying URL Patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 7.7.2 Constructing Customized URLs . . . . . . . . . . . . . . . . . . . . . . . . . 83 v 8 Control Reference : Standard Controls 85 8.1 TButton . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 8.2 TCheckBox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 8.3 TClientScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 8.3.1 Including Bundled Javascript Libraries in Prado . . . . . . . . . . . . . . . 86 8.3.2 Including Custom Javascript Files . . . . . . . . . . . . . . . . . . . . . . . 87 8.3.3 Including Custom Javascript Code Blocks . . . . . . . . . . . . . . . . . . . 87 8.4 TColorPicker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 8.5 TDatePicker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 8.6 TExpression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 8.7 TFileUpload . . . . . . . . . . . . . . . . . . . .
  • Univers Univers
  • Ebooks Ebooks
  • Livres audio Livres audio
  • Presse Presse
  • Podcasts Podcasts
  • BD BD
  • Documents Documents