Author: fschulze
Date: Thu Nov 17 12:29:58 2005
New Revision: 1866

Modified:
   azax/trunk/demos/azaxdemo/azaxview.py
   azax/trunk/demos/azaxdemo/browser/azax_instant_edit.pt
   azax/trunk/demos/azaxdemo/browser/azax_three_autoupdate.azax
   azax/trunk/demos/azaxdemo/browser/azax_three_autoupdate.pt
   azax/trunk/demos/azaxdemo/configure.zcml
Log:
Added demo for automatic attaching of events to new nodes.

Modified: azax/trunk/demos/azaxdemo/azaxview.py
==============================================================================
--- azax/trunk/demos/azaxdemo/azaxview.py       (original)
+++ azax/trunk/demos/azaxdemo/azaxview.py       Thu Nov 17 12:29:58 2005
@@ -71,6 +71,12 @@
         return_object.setHtmlAsChild('select#second', ' '.join(result))
         return return_object()
 
+    def getAutoupdateMarkup(self):
+        """ returns the current time """
+        return_object = AzaxResponse(self.request.response)
+        return_object.setHtmlAsChild('div#update-wrapper', '<div 
id="update-area"></div>')
+        return return_object()
+
     def getCurrentTime(self):
         """ returns the current time """
         return_object = AzaxResponse(self.request.response)
@@ -81,7 +87,8 @@
         """ returns the current time """
         return_object = AzaxResponse(self.request.response)
         return_object.setHtmlAsChild('div#text', 
-                                                '<input type="text" 
name="value" value="'+value+'" />'
+                                                '<input type="text" 
name="value" value="'+value+'" />' \
+                                                '<input type="button" 
value="save" id="save" />'
                                                 )
         return return_object()
         

Modified: azax/trunk/demos/azaxdemo/browser/azax_instant_edit.pt
==============================================================================
--- azax/trunk/demos/azaxdemo/browser/azax_instant_edit.pt      (original)
+++ azax/trunk/demos/azaxdemo/browser/azax_instant_edit.pt      Thu Nov 17 
12:29:58 2005
@@ -28,8 +28,6 @@
         click me!
         <input type="hidden" name="value" value="click me!"  />
         </div>
-        <br />
-        <input type="button" value="save" id="save" />
     </form>
   </body>
 </html>

Modified: azax/trunk/demos/azaxdemo/browser/azax_three_autoupdate.azax
==============================================================================
--- azax/trunk/demos/azaxdemo/browser/azax_three_autoupdate.azax        
(original)
+++ azax/trunk/demos/azaxdemo/browser/azax_three_autoupdate.azax        Thu Nov 
17 12:29:58 2005
@@ -2,6 +2,8 @@
 <rules>
   <rule selector="div#update-area">
     <kukitevent name="timeout">getCurrentTime</kukitevent>
-    <event name="click">getCurrentTime</event>
+  </rule>
+  <rule selector="input#start-update">
+    <event name="click">getAutoupdateMarkup</event>
   </rule>
 </rules>

Modified: azax/trunk/demos/azaxdemo/browser/azax_three_autoupdate.pt
==============================================================================
--- azax/trunk/demos/azaxdemo/browser/azax_three_autoupdate.pt  (original)
+++ azax/trunk/demos/azaxdemo/browser/azax_three_autoupdate.pt  Thu Nov 17 
12:29:58 2005
@@ -43,7 +43,8 @@
     <h2>Three autoupdate</h2>
 
 <h3>Demo</h3>
-    <div id="update-area">
+    <div id="update-wrapper">
     </div>
+    <input type="button" id="start-update" />
   </body>
 </html>

Modified: azax/trunk/demos/azaxdemo/configure.zcml
==============================================================================
--- azax/trunk/demos/azaxdemo/configure.zcml    (original)
+++ azax/trunk/demos/azaxdemo/configure.zcml    Thu Nov 17 12:29:58 2005
@@ -138,6 +138,14 @@
       permission="zope2.View"
       />
 
+  <browser:page
+      for=".interfaces.ISimpleContent"
+      class=".azaxview.AzaxView"
+      attribute="getAutoupdateMarkup"
+      name="getAutoupdateMarkup"
+      permission="zope2.View"
+      />
+
   <browser:resource
     file="browser/azax_instant_edit.azax"
     name="azax_instant_edit.azax"
@@ -159,4 +167,5 @@
       permission="zope2.View"
       />
 
+>>>>>>> .r1865
 </configure>
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to