Wiki source code of ERPrototaculous
Version 268.1 by Ravi Mendis on 2009/07/17 01:21
Hide last authors
author | version | line-number | content |
---|---|---|---|
![]() |
100.1 | 1 | == Introduction == |
2 | |||
![]() |
209.1 | 3 | ERPrototaculous was developed to provide the ajax functionality in ERDivaLook. |
4 | |||
5 | === What is ERPrototaculous? === | ||
6 | |||
![]() |
233.1 | 7 | Features include: |
![]() |
209.1 | 8 | |
![]() |
233.1 | 9 | * 'Organic' support for Prototype and Scriptaculous in WebObjects. |
![]() |
265.1 | 10 | ** Light-weight dynamic WebObjects elements to support Prototype |
11 | ** No custom patches to Prototype | ||
12 | ** Sans custom Prototype extensions | ||
![]() |
261.1 | 13 | * Use of [[Unobtrusive Javascript>>http://en.wikipedia.org/wiki/Unobtrusive_JavaScript]]. |
14 | * Pseudo-stateless ajax responses | ||
![]() |
245.1 | 15 | * A set of widgets in the Prototype + Scriptaculous family. |
![]() |
233.1 | 16 | |
17 | ==== Unobtrusive Javascript in ERPrototaculous ==== | ||
18 | |||
19 | Unobtrusive javascript is used in contrast to on-demand style of ajax programming. | ||
![]() |
267.1 | 20 | By including Javascript as well as CSS globally in the page wrapper, CSS and Javascript don't have to load inside each and every ajax requests. |
![]() |
233.1 | 21 | |
22 | The result is **faster** and more **reliable** ajax in WebObjects applications. | ||
23 | |||
![]() |
259.1 | 24 | ==== Prototype WebObjects Elements ==== |
![]() |
253.1 | 25 | |
![]() |
259.1 | 26 | ##Ajax.Updater## and ##Ajax.Request## have been implemented as WebObjects dynamic elements. |
27 | |||
![]() |
253.1 | 28 | ===== Ajax.Updater ===== |
29 | |||
30 | Support for Prototype's [[Ajax.Updater>>http://www.prototypejs.org/api/ajax/updater]] is in the form of three components: | ||
31 | |||
![]() |
261.1 | 32 | * AjaxUpdaterLink |
33 | * AjaxUpdaterButton | ||
34 | * AjaxUpdaterForm (with ##onsubmit## for ajax form submission) | ||
![]() |
253.1 | 35 | |
![]() |
261.1 | 36 | These components will update a **container** on the page. |
37 | |||
38 | ===== Ajax.Request ===== | ||
39 | |||
40 | Prototype's [[Ajax.Request>>http://www.prototypejs.org/api/ajax/request]] is in the form of: | ||
41 | |||
42 | * AjaxRequestLink | ||
43 | * AjaxRequestButton | ||
44 | |||
45 | These are used for strictly **background** ajax communication. | ||
46 | |||
![]() |
229.1 | 47 | ==== Prototype + Scriptaculous Widgets ==== |
![]() |
211.1 | 48 | |
![]() |
209.1 | 49 | * Accordion |
50 | * LightWindow | ||
51 | * ModalBox | ||
52 | * CalendarDateSelect | ||
53 | * FileUpload | ||
![]() |
233.1 | 54 | |
55 | == Forms in ERPrototaculous == | ||
56 | |||
57 | Differences from using forms in WebObjects. i.e ##WOForm##: | ||
58 | |||
![]() |
261.1 | 59 | 1. All form controls must be named. This includes text fields, selects and buttons. |
![]() |
233.1 | 60 | (WebObjects dynamically assigned names are not compatible with ERPrototaculous). |
![]() |
261.1 | 61 | 1. All forms in an ERPrototaculous app are instances of ##AjaxUpdaterForm##. |
62 | 1. Form submits can be the form of a: | ||
63 | |||
64 | * | ||
![]() |
263.1 | 65 | ** Static ##<button>##. |
66 | ** WOSubmitButton (if the result is to update whole page/app). | ||
![]() |
233.1 | 67 | ** AjaxUpdaterButton (to update a **container**). Or |
![]() |
263.1 | 68 | ** AjaxRequestButton (for a **background** ajax request). |
![]() |
261.1 | 69 | |
70 | == Ajax Page Caching in ERPrototaculous == | ||
71 | |||
72 | One notable difference in the ERPrototaculous and Ajax.framework is in the ajax responses. | ||
73 | ERPrototaculous updates and actions break with "The WebObjects Way" by being pseudo-stateless. | ||
74 | |||
![]() |
263.1 | 75 | Instead of returning a fresh response, an ajax update or action is in fact the same instance. |
![]() |
261.1 | 76 | |
![]() |
263.1 | 77 | The reason returning a fresh response is not necessary is because a client never travels back or forwards through an ajax application unlike in a typical WebObjects app. |
78 | Here the current state of the update or action is all that is necessary. |