Changes for page ERPrototaculous

Last modified by Ravi Mendis on 2010/11/18 05:07

From version 199.1
edited by Ravi Mendis
on 2009/07/17 06:30
Change comment: There is no comment for this version
To version 204.1
edited by Ravi Mendis
on 2009/07/22 05:29
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -24,21 +24,21 @@
24 24  
25 25  ==== Prototype WebObjects Elements ====
26 26  
27 -##Ajax.Updater## and ##Ajax.Request## have been implemented as WebObjects dynamic elements.
27 +##Ajax.Updater## and ##Ajax.Request## have been implemented as WebObjects elements.
28 28  
29 29  ===== Ajax.Updater =====
30 30  
31 -Support for Prototype's [[Ajax.Updater>>http://www.prototypejs.org/api/ajax/updater]] is in the form of three components:
31 +Support for Prototype's [[Ajax.Updater>>http://www.prototypejs.org/api/ajax/updater]] is in the form of three elements:
32 32  
33 33  * AjaxUpdaterLink
34 34  * AjaxUpdaterButton
35 35  * AjaxUpdaterForm (with ##onsubmit## for ajax form submission)
36 36  
37 -These components will update a **container** on the page:
37 +These components will update //any// **container** on the page:
38 38  
39 39  {{code value="javascript"}}
40 40  
41 - new Ajax.Updater('container', url, {options});
41 +new Ajax.Updater('container', url, {options});
42 42  
43 43  {{/code}}
44 44  
... ... @@ -53,7 +53,7 @@
53 53  
54 54  {{code value="javascript"}}
55 55  
56 - new Ajax.Request(url, {options});
56 +new Ajax.Request(url, {options});
57 57  
58 58  {{/code}}
59 59  
... ... @@ -71,26 +71,30 @@
71 71  
72 72  Differences from using forms in WebObjects. i.e ##WOForm##:
73 73  
74 -1. All form controls must be named. This includes text fields, selects and buttons.
74 +1. All ajax form controls must be named. This includes text fields, selects and buttons.
75 75  (WebObjects dynamically assigned names are not compatible with ERPrototaculous).
76 76  1. All ajax forms in an ERPrototaculous app need to be instances of ##AjaxUpdaterForm##.
77 -1. Form submit buttons can be a:
77 +1. Ajax form submit buttons can be a:
78 +1*. Static ##<button>##.
79 +1*. WOSubmitButton (if the result is to update whole page/app).
80 +1*. AjaxUpdaterButton (to update a **container**). Or
81 +1*. AjaxRequestButton (for a **background** ajax request).
78 78  
79 -*
80 -** Static ##<button>##.
81 -** WOSubmitButton (if the result is to update whole page/app).
82 -** AjaxUpdaterButton (to update a **container**). Or
83 -** AjaxRequestButton (for a **background** ajax request).
84 -
85 85  So forms are different in Ajax.framework and ERPrototaculous.
86 86  
87 87  In ERPrototaculous you may still have typical WebObjects forms (i.e WOForm) as well as use ajax forms (i.e **AjaxUpdaterForm**).
88 88  They behave differently in that an AjaxUpdaterForm will update the contents of a container as opposed to the entire page.
89 89  
88 +{{warning title="Warning"}}
89 +
90 +You must *name your form controls*, otherwise under certain circumstances Prototype (ajax) form submission will break.
91 +
92 +{{/warning}}
93 +
90 90  == Ajax Response Handling in ERPrototaculous ==
91 91  
92 92  One notable difference between the ERPrototaculous and Ajax frameworks is in the way they handle ajax responses.
93 -In ERPrototaculous, updates and actions break with "The WebObjects Way" by being pseudo-stateless.
97 +In ERPrototaculous, updates and actions break with //The WebObjects Way// by being pseudo-stateless.
94 94  
95 95  WebObjects typically vends a fresh response for each and every action. With ajax, this is not necessary.
96 96  
... ... @@ -100,15 +100,21 @@
100 100  
101 101  So for ajax, the current state of the page fragment component is all that is necessary.
102 102  
107 +{{info title="No More"}}
108 +
109 +A 100% ajax WO-app (like an [ERDivaLook|ERDivaLook] app) is no longer be plagued by the well known _limitation_ of WebObjects - the browser *backtrack problem*.
110 +
111 +{{/info}}
112 +
103 103  == Ajax Actions in ERPrototaculous ==
104 104  
105 105  Typically, in a WebObjects application, an action would return the contents of the entire page.
106 106  
107 107  Ajax responses are mostly page fragments or just part of a page.
108 -So you should make sure the actions in ERPrototaculous (or AjaxUpdaterButton and AjaxRequestButton) return the proper page fragment as opposed to the entire page.
118 +So you should make sure the actions in ERPrototaculous (or AjaxUpdaterButton and AjaxRequestButton) return the proper page fragment as opposed to the entire page.
109 109  This breaks with WO-tradition, so this is where you need to be careful.
110 110  
111 -{{note title="Actions"}}
121 +{{note title="Note"}}
112 112  
113 113  ERPrototaculous actions *differ* from Ajax.framework actions - _They must return only the page fragment_.
114 114  
... ... @@ -123,3 +123,4 @@
123 123  It is similar to an AjaxUpdateContainer when it has the binding ##ajax = true##, otherwise it's pretty much like **WOGenericContainer**.
124 124  
125 125  It has been implemented as a utility or //convenience// for Prototype's ##Ajax.Updater##.
136 +That is it can be used to update from a popup //onchange//, or from a Prototype //callback// like //onComplete//, etc.