[claw-cvs] r79 - trunk/main/claw-html.dojo/src

achiumenti at common-lisp.net achiumenti at common-lisp.net
Mon Sep 1 15:34:52 UTC 2008


Author: achiumenti
Date: Mon Sep  1 11:34:52 2008
New Revision: 79

Modified:
   trunk/main/claw-html.dojo/src/djbutton.lisp
   trunk/main/claw-html.dojo/src/djdialog.lisp
   trunk/main/claw-html.dojo/src/djform.lisp
   trunk/main/claw-html.dojo/src/djlink.lisp
   trunk/main/claw-html.dojo/src/djtooltip.lisp
Log:
bufixs on form related components

Modified: trunk/main/claw-html.dojo/src/djbutton.lisp
==============================================================================
--- trunk/main/claw-html.dojo/src/djbutton.lisp	(original)
+++ trunk/main/claw-html.dojo/src/djbutton.lisp	Mon Sep  1 11:34:52 2008
@@ -33,7 +33,7 @@
   ()
   (:metaclass metacomponent)
   (:documentation "Class for dojo dijit.form.Button component. More info at http://api.dojotoolkit.org/")
-  (:default-initargs :dojo-type "dijit.form.Button"))
+  (:default-initargs :dojo-type "dijit.form.Button" :tag-name "button"))
 
 (defclass djdrop-down-button (djwidget)
   ()
@@ -67,8 +67,10 @@
   (let* ((id (htcomponent-client-id obj))
 	 (value (csubmit-value obj)))
     (djbutton> :static-id id
+               :type "submit"
+               :value value
                (wcomponent-informal-parameters obj)
-               value)))
+               (or (htcomponent-body obj) value))))
 
 (defmethod wcomponent-before-prerender ((obj djsubmit-button) (page page))
   (setf (djsubmit-button-form obj) (page-current-form page)))
@@ -76,13 +78,3 @@
 (defmethod wcomponent-before-render ((obj djsubmit-button) (page page))
   (setf (djsubmit-button-form obj) (page-current-form page)))
 
-(defmethod htcomponent-instance-initscript ((obj djsubmit-button))
-  (let ((id (htcomponent-client-id obj))
-        (form-id (htcomponent-client-id (djsubmit-button-form obj))))
-    (ps*
-     `(dojo.connect (dijit.by-id ,id)
-                    "onClick"
-                    (lambda (e) (let ((the-form (dijit.by-id ,form-id)))
-                                  (unless the-form
-                                    (setf the-form (dojo.by-id ,form-id)))
-                                  (.submit the-form)))))))

Modified: trunk/main/claw-html.dojo/src/djdialog.lisp
==============================================================================
--- trunk/main/claw-html.dojo/src/djdialog.lisp	(original)
+++ trunk/main/claw-html.dojo/src/djdialog.lisp	Mon Sep  1 11:34:52 2008
@@ -38,7 +38,9 @@
 (defclass djdialog (wcomponent)
   ()
   (:metaclass metacomponent)
-  (:documentation "Class for dojo dijit.Dialog component. More info at http://api.dojotoolkit.org/. It adds a HardLink so that the Dialog, that is moved inside body, may be referenced where it war originally placed, and so can be deleted from there"))
+  (:documentation "Class for dojo dijit.Dialog component. 
+You cannot directly call a json update on this component, but update its container instead!!!
+More info at http://api.dojotoolkit.org/. It adds a HardLink so that the Dialog, that is moved inside body, may be referenced where it war originally placed, and so can be deleted from there"))
 
 (defmethod wcomponent-template ((obj djdialog))
   (let ((id (htcomponent-client-id obj)))
@@ -57,7 +59,9 @@
 (defclass djdialog-underlay (wcomponent)
   ()
   (:metaclass metacomponent)
-  (:documentation "Class for dojo dijit.DialogUnderlay component. More info at http://api.dojotoolkit.org/. It adds a HardLink so that the Dialog, that is moved inside body, may be referenced where it war originally placed, and so can be deleted from there"))
+  (:documentation "Class for dojo dijit.DialogUnderlay component. 
+You cannot directly call a json update on this component, but update its container instead!!!
+More info at http://api.dojotoolkit.org/. It adds a HardLink so that the Dialog, that is moved inside body, may be referenced where it war originally placed, and so can be deleted from there"))
 
 (defmethod wcomponent-template ((obj djdialog-underlay))
   (let ((id (htcomponent-client-id obj)))

Modified: trunk/main/claw-html.dojo/src/djform.lisp
==============================================================================
--- trunk/main/claw-html.dojo/src/djform.lisp	(original)
+++ trunk/main/claw-html.dojo/src/djform.lisp	Mon Sep  1 11:34:52 2008
@@ -40,23 +40,17 @@
   (:documentation "Class to generate a <form> element that is capable of XHR requests. More info at http://api.dojotoolkit.org/")
   (:default-initargs :dojo-type "claw.Form" :update-id () :ajax-form-p t))
 
-(defmethod wcomponent-template((obj djform))
-  (let ((id (htcomponent-client-id obj))
-        (method (form-method obj))
-        (dojo-type (djwidget-dojo-type obj))
+
+(defmethod wcomponent-template :before ((obj djform))
+  (let ((dojo-type (djwidget-dojo-type obj))
         (update-id (update-id obj)))
-    (form> :static-id id
-           :xhr (djform-ajax-form-p obj)
-           :method method
-           :dojotype dojo-type
-           :update-id (when update-id
-                        (let ((js-array (ps* `(array ,update-id))))
-                          (subseq js-array 0 (1- (length js-array)))))
-           (wcomponent-informal-parameters obj)
-           (input> :name *rewind-parameter*
-                   :type "hidden"
-                   :value id)
-           (htcomponent-body obj))))
+    (setf (wcomponent-informal-parameters obj) 
+          (append (wcomponent-informal-parameters obj)
+                  (list :xhr (djform-ajax-form-p obj)
+                        :dojotype dojo-type
+                        :update-id (when update-id
+                                     (let ((js-array (ps* `(array ,update-id))))
+                                       (subseq js-array 0 (1- (length js-array))))))))))
 
 
 (defmethod htcomponent-instance-initscript ((obj djform))

Modified: trunk/main/claw-html.dojo/src/djlink.lisp
==============================================================================
--- trunk/main/claw-html.dojo/src/djlink.lisp	(original)
+++ trunk/main/claw-html.dojo/src/djlink.lisp	Mon Sep  1 11:34:52 2008
@@ -40,7 +40,8 @@
 (defmethod wcomponent-template((o djaction-link))
   (let ((client-id (htcomponent-client-id o))
         (update-id (update-id o))
-        (dojo-type (djwidget-dojo-type o)))
+        (dojo-type (djwidget-dojo-type o))
+        (params (action-link-parameters o)))
     (a> :static-id client-id
 	:href "#"
         :hxr t
@@ -48,6 +49,8 @@
         :update-id (when update-id
                      (let ((js-array (ps* `(array ,update-id))))
                        (subseq js-array 0 (1- (length js-array)))))
+        :parameters (let ((json-content (ps* `(create , at params))))
+                      (subseq json-content 0 (1- (length json-content))))
 	(wcomponent-informal-parameters o)
 	(htcomponent-body o))))
 

Modified: trunk/main/claw-html.dojo/src/djtooltip.lisp
==============================================================================
--- trunk/main/claw-html.dojo/src/djtooltip.lisp	(original)
+++ trunk/main/claw-html.dojo/src/djtooltip.lisp	Mon Sep  1 11:34:52 2008
@@ -38,7 +38,9 @@
 (defclass djtooltip (wcomponent)
   ()
   (:metaclass metacomponent)
-  (:documentation "Class for dojo dijit.Tooltip component. More info at http://api.dojotoolkit.org/. It adds a HardLink so that the Dialog, that is moved inside body, may be referenced where it war originally placed, and so can be deleted from there"))
+  (:documentation "Class for dojo dijit.Tooltip component. 
+You cannot directly call a json update on this component, but update its container instead!!!
+More info at http://api.dojotoolkit.org/. It adds a HardLink so that the Dialog, that is moved inside body, may be referenced where it war originally placed, and so can be deleted from there"))
 
 (defmethod wcomponent-template ((obj djtooltip))
   (let ((id (htcomponent-client-id obj)))    



More information about the Claw-cvs mailing list