Changes for page ERPrototaculous

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

From version 319.1
edited by Ravi Mendis
on 2010/11/18 05:07
Change comment: There is no comment for this version
To version 318.1
edited by Ravi Mendis
on 2010/11/18 05:07
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -6,17 +6,17 @@
6 6  
7 7  Features include:
8 8  
9 -* 'Organic' support for [[Prototype>>url:http://www.prototypejs.org/||shape="rect"]] and [[Scriptaculous>>url:http://script.aculo.us/||shape="rect"]] in WebObjects.
9 +* 'Organic' support for [[Prototype>>http://www.prototypejs.org/]] and [[Scriptaculous>>http://script.aculo.us/]] in WebObjects.
10 10  ** Light-weight dynamic elements to support Prototype
11 11  ** Transparent API that doesn't hide or abstract Prototype and Scriptaculous
12 12  ** Sans patches or extensions to Prototype
13 -* Use of [[Unobtrusive Javascript>>url:http://en.wikipedia.org/wiki/Unobtrusive_JavaScript||shape="rect"]].
13 +* Use of [[Unobtrusive Javascript>>http://en.wikipedia.org/wiki/Unobtrusive_JavaScript]].
14 14  * Pseudo-stateless ajax responses
15 15  * A set of widgets in the Prototype + Scriptaculous family.
16 16  
17 17  ==== Unobtrusive Javascript in ERPrototaculous ====
18 18  
19 -{{include 0="WO:Using Unobtrusive JavaScript"/}}
19 +{{include value="WO:Using Unobtrusive JavaScript"}}{{/include}}
20 20  
21 21  {{code}}
22 22  
... ... @@ -26,19 +26,19 @@
26 26  
27 27  ==== Prototype WebObjects Elements ====
28 28  
29 -{{code language="none"}}Ajax.Updater{{/code}} and {{code language="none"}}Ajax.Request{{/code}} have been implemented as WebObjects elements.
29 +##Ajax.Updater## and ##Ajax.Request## have been implemented as WebObjects elements.
30 30  
31 31  ===== Ajax.Updater =====
32 32  
33 -Support for Prototype's [[Ajax.Updater>>url:http://www.prototypejs.org/api/ajax/updater||shape="rect"]] is in the form of three elements:
33 +Support for Prototype's [[Ajax.Updater>>http://www.prototypejs.org/api/ajax/updater]] is in the form of three elements:
34 34  
35 35  * AjaxUpdaterLink
36 36  * AjaxUpdaterButton
37 -* AjaxUpdaterForm (with {{code language="none"}}onsubmit{{/code}} for ajax form submission)
37 +* AjaxUpdaterForm (with ##onsubmit## for ajax form submission)
38 38  
39 39  These components will update //any// **container** on the page:
40 40  
41 -{{code 0="javascript"}}
41 +{{code value="javascript"}}
42 42  
43 43  new Ajax.Updater('container', url, {options});
44 44  
... ... @@ -46,7 +46,7 @@
46 46  
47 47  ===== Ajax.Request =====
48 48  
49 -Prototype's [[Ajax.Request>>url:http://www.prototypejs.org/api/ajax/request||shape="rect"]] is in the form of:
49 +Prototype's [[Ajax.Request>>http://www.prototypejs.org/api/ajax/request]] is in the form of:
50 50  
51 51  * AjaxRequestLink
52 52  * AjaxRequestButton
... ... @@ -53,7 +53,7 @@
53 53  
54 54  These are used for strictly **background** ajax communication:
55 55  
56 -{{code 0="javascript"}}
56 +{{code value="javascript"}}
57 57  
58 58  new Ajax.Request(url, {options});
59 59  
... ... @@ -61,24 +61,23 @@
61 61  
62 62  ==== Prototype + Scriptaculous Widgets ====
63 63  
64 -(% class="alternate" %)
65 65  * Accordion
66 66  * LightWindow
67 67  * ModalBox
68 68  * CalendarDateSelect
69 -* [[FileUpload>>url:http://valums.com/ajax-upload/||shape="rect"]]
68 +* [[FileUpload>>http://valums.com/ajax-upload/]]
70 70  
71 71  Support for these widgets have been similarly implemented as **button** and **link** variants, depending whether it is used inside a form or not.
72 72  
73 73  == Ajax Forms in ERPrototaculous ==
74 74  
75 -Differences from using forms in WebObjects. i.e {{code language="none"}}WOForm{{/code}}:
74 +Differences from using forms in WebObjects. i.e ##WOForm##:
76 76  
77 77  1. All ajax form controls must be named. This includes text fields, selects and buttons.
78 - (WebObjects dynamically assigned names are not compatible with ERPrototaculous).
79 -1. All ajax forms in an ERPrototaculous app need to be instances of {{code language="none"}}AjaxUpdaterForm{{/code}}.
77 +(WebObjects dynamically assigned names are not compatible with ERPrototaculous).
78 +1. All ajax forms in an ERPrototaculous app need to be instances of ##AjaxUpdaterForm##.
80 80  1. Ajax form submit buttons can be a:
81 -1*. Static {{code language="none"}}<button>{{/code}}.
80 +1*. Static ##<button>##.
82 82  1*. WOSubmitButton (if the result is to update whole page/app).
83 83  1*. AjaxUpdaterButton (to update a **container**). Or
84 84  1*. AjaxRequestButton (for a **background** ajax request).
... ... @@ -86,20 +86,22 @@
86 86  So forms are different in Ajax.framework and ERPrototaculous.
87 87  
88 88  In ERPrototaculous you may still have typical WebObjects forms (i.e WOForm) as well as use ajax forms (i.e **AjaxUpdaterForm**).
89 - They behave differently in that an AjaxUpdaterForm will update the contents of a container as opposed to the entire page.
88 +They behave differently in that an AjaxUpdaterForm will update the contents of a container as opposed to the entire page.
90 90  
91 91  {{warning title="Warning"}}
92 -You must **name your form controls**, otherwise under certain circumstances Prototype (ajax) form submission will break.
91 +
92 +You must *name your form controls*, otherwise under certain circumstances Prototype (ajax) form submission will break.
93 +
93 93  {{/warning}}
94 94  
95 -= Embrace Statelessness! =
96 += Embrace Statelessness =
96 96  
97 -{{include 0="WO:Embrace Statelessness"/}}
98 +{{include value="WO:Embrace Statelessness"}}{{/include}}
98 98  
99 -ERPrototaculous embraces the stateless model Ajax offers in exchange for simplifying the work WebObjects has to do - it's a win-win!
100 +ERPrototaculous embraces the stateless model Ajax offers in exchange for simplifying the work WebObjects has to do -- it's a win--win
100 100  
101 101  So you may observe one notable difference between the ERPrototaculous and Ajax frameworks is in the way they handle ajax responses.
102 - In ERPrototaculous, updates and actions break with typical WebObjects behavior by being pseudo-stateless.
103 +In ERPrototaculous, updates and actions break with typical WebObjects behavior by being pseudo-stateless.
103 103  
104 104  === Ajax Response Handling in ERPrototaculous ===
105 105  
... ... @@ -106,12 +106,14 @@
106 106  In a typical WebObjects application, when a user navigates to the previous page using the browser back button and subsequently clicks on a link in on that page, WebObjects needs to remember how to handle that action and to return the correct page. This is no longer necessary for ajax.
107 107  
108 108  A user never travels backwards or forwards through the ajax application history.
109 - (i.e there is no forward/back buttons for ajax requests - just as there aren't forward/back buttons on desktop apps).
110 +(i.e there is no forward/back buttons for ajax requests - just as there aren't forward/back buttons on desktop apps).
110 110  
111 111  So for ajax, the current state of the page fragment component is all that is necessary.
112 112  
113 -{{info title="No More ~"You backtracked too far~""}}
114 -A 100% ajax WO-app (like an [[ERDivaLook>>doc:ERDivaLook]] app) is no longer plagued by the well known //limitation// of WebObjects - the browser **backtrack problem**.
114 +{{info title="No More"}}
115 +
116 +A 100% ajax WO-app (like an [ERDivaLook|ERDivaLook] app) is no longer plagued by the well known _limitation_ of WebObjects - the browser *backtrack problem*.
117 +
115 115  {{/info}}
116 116  
117 117  == Ajax Actions in ERPrototaculous ==
... ... @@ -119,11 +119,13 @@
119 119  Typically, in a WebObjects application, an action would return the contents of the entire page.
120 120  
121 121  Ajax responses are mostly page fragments or just part of a page.
122 - So you should make sure the actions in ERPrototaculous (or AjaxUpdaterButton and AjaxRequestButton) return the proper page fragment as opposed to the entire page.
123 - This is different to how WebObjects normally works, so this is where you need to be careful.
125 +So you should make sure the actions in ERPrototaculous (or AjaxUpdaterButton and AjaxRequestButton) return the proper page fragment as opposed to the entire page.
126 +This is different to how WebObjects normally works, so this is where you need to be careful.
124 124  
125 125  {{note title="Note"}}
126 -ERPrototaculous actions **differ** from Ajax.framework actions - //They must return only the page fragment//.
129 +
130 +ERPrototaculous actions *differ* from Ajax.framework actions - _They must return only the page fragment_.
131 +
127 127  {{/note}}
128 128  
129 129  To assist with page fragments inside **forms**, you can make your ajax action responses a subclass of **WXPageFragment** (a utility to handle the forms processing between Prototype and WebObjects).
... ... @@ -131,18 +131,21 @@
131 131  == Update Containers in ERPrototaculous ==
132 132  
133 133  Perhaps the only real similarity to Ajax.framework is the ajax update container.
134 - **WXGenericContainer** is the ERPrototaculous update container.
135 - It is similar to an AjaxUpdateContainer when it has the binding {{code language="none"}}ajax = true{{/code}}, otherwise it's pretty much like **WOGenericContainer**.
139 +**WXGenericContainer** is the ERPrototaculous update container.
140 +It is similar to an AjaxUpdateContainer when it has the binding ##ajax = true##, otherwise it's pretty much like **WOGenericContainer**.
136 136  
137 -It has been implemented as a utility or //convenience// for Prototype's {{code language="none"}}Ajax.Updater{{/code}}.
138 - That is it can be used to update from a DOM //event// like popup //onchange//, or from a Prototype //callback// like //onComplete//, etc.
142 +It has been implemented as a utility or //convenience// for Prototype's ##Ajax.Updater##.
143 +That is it can be used to update from a DOM //event// like popup //onchange//, or from a Prototype //callback// like //onComplete//, etc.
139 139  
140 140  == Compatibility ==
141 141  
142 142  ERPrototaculous can not be used with WebObjects 5.3 as it is dependent on the hooks for ajax added to WebObjects with version 5.4.
143 143  
144 -{{warning title="ERPrototaculous is WebObjects *5.4* compatible only"/}}
149 +{{warning title="ERPrototaculous is WebObjects *5.4* compatible only"}}
145 145  
151 +
152 +{{/warning}}
153 +
146 146  == External Links ==
147 147  
148 -WOWODC '10 (Slides) - [[DirectToWeb 2.0>>url:http://www.wocommunity.org/wowodc10/slides/D2W2.pdf||shape="rect"]]
156 +WOWODC '10 (Slides) - [[DirectToWeb 2.0>>http://www.wocommunity.org/wowodc10/slides/D2W2.pdf]]