
New patches:

[- asdf fix: :ajax module added to :components
evrim@core.gen.tr**20060506221959] {
hunk ./ucw.asd 95
-                               (:file "window"))
+                               (:file "window")
+ 			       (:module :ajax
+ 					:serial t
+ 					:components ((:file "component")
+ 						     (:file "window")
+ 						     (:file "event")
+ 						     (:file "js")
+ 						     (:file "fx")
+ 						     (:file "loading")
+ 						     (:file "pager"))))
hunk ./ucw.asd 106
+		 
}

[ajax empty component files.
evrim@core.gen.tr**20060506222537] {
adddir ./src/components/ajax
addfile ./src/components/ajax/component.lisp
addfile ./src/components/ajax/event.lisp
addfile ./src/components/ajax/fx.lisp
addfile ./src/components/ajax/js.lisp
addfile ./src/components/ajax/loading.lisp
addfile ./src/components/ajax/pager.lisp
addfile ./src/components/ajax/window.lisp
}

[- added ajax exports and import to ucw package definition.
evrim@core.gen.tr**20060506222758] {
hunk ./src/packages.lisp 12
+  (:import-from :js #:gen-js-name-string #:js-to-string)
hunk ./src/packages.lisp 288
-   #:bye-bye))
+   #:bye-bye
+
+   ;; Ajax stuff
+   #:*dojo-url*
+
+   #:render-css
+   #:render-javascript
+   #:defserver-callback
+   #:event-connect
+   #:defclient-callback
+   #:refresh-ajax-component
+   #:callback-name
+
+   ;;ajax pager
+   #:pager
+   #:pager.per-page
+   #:pager.link-count
+   #:pager.data
+   #:render-list-item))
}

[ajax-widget-component, primitive object.
evrim@core.gen.tr**20060506222939] {
hunk ./src/components/ajax/component.lisp 1
+(in-package :it.bese.ucw)
+
+(defcomponent ajax-widget-component (generic-widget-component)
+  ()
+  (:default-initargs
+    :css-class "component"
+    :css-id (gen-js-name-string :prefix "component_"))
+  (:documentation "Ajax widget, used to wrap a component with a <:div"))
+
+;;;; Ajax action to be called from any regular ucw action which
+;;;; enables the system to reload the contents of the widget into the
+;;;; browser.
+;;;;
+;;;; Call it inside your actions like (refresh-ajax-component widget t t t)
+;;;; to update the instance viewed to user.
+;;;;
+;;;; For a specific widget, html/css/javascript parts can be updated seperately.
+;;;;
+;;;; For updating several components at once, just call this action more than once
+;;;; for the components that you want to update.
+(defaction refresh-ajax-component ((widget ajax-widget-component)
+				   &optional (html t) (css t) (javascript t))
+  (ucw::with-yaclml-stream
+      (html-stream (ucw::context.response *context*))
+    (<:div :class "component"
+	   :id (ucw::widget-component.css-id widget)
+	   ;;;; Below statement is necessary to fix a bug in IE dom parser
+	   ;;;; which makes impossible to use innerHTML.
+	   (when (not html)
+	     (<:as-is "unused"))
+	   
+	   (when html
+	     (<:div :class "html"
+		  (render widget)))
+	   
+	   (when css
+	     (<:div :class "css" :id (css-index (ucw::context.window-component *context*) widget)
+		    (render-css widget)))
+	   
+	   (when javascript
+	     (<:div :class "javascript"
+		    (render-javascript widget)))))
+
+  ;;;; Set context.done to t in order to make ucw
+  ;;;; not to call render method.
+  (setf (ucw::context.done *context*) t))
+
+(defmethod render :wrapping ((widget ajax-widget-component))
+  (let ((window (context.window-component *context*)))
+    (when (and window (typep window 'simple-ajax-window))
+      (if (not (member widget (rendered-components window)))
+	  (setf (rendered-components window) (cons widget (rendered-components window))))))
+  (<:div :class (ucw::widget-component.css-class widget)
+	 :id (ucw::widget-component.css-id widget)
+   (call-next-method)))
+
+(defgeneric render-css (component)
+  (:documentation "The generic entry point for rendering
+  style & css that belongs to the component.")
+  (:method-combination wrapping-standard))
+
+(defmethod render-css ((widget ajax-widget-component))
+  "Default method to override in order to provide inline style."
+;;   (<:style :type "text/css"
+;; 	   (<:as-is "div.component#" (slot-value widget 'css-id) " { "
+;; 		    "color: #cc0000"
+;; 		    "; }"))
+  )
+(defmethod js-component-id ((widget ajax-widget-component))
+  (intern (ucw::widget-component.css-id widget)))
+
+(defgeneric render-javascript (component)
+  (:documentation "The generic entry point for rendering
+  event methods and other javascript code that belongs to the component.")
+  (:method-combination wrapping-standard))
+
+
+(defmethod render-javascript :wrapping ((widget ajax-widget-component))
+  (<:script :type "text/javascript"
+ 	    (<:as-is ~% "// <![CDATA[" ~%
+		       (js:js*
+			`(setf ,(js-component-id widget) (new (*object)))))
+	    (call-next-method)
+	    (<:as-is  ~% "// ]]>" ~%)))
+
+
+(defmethod render-javascript ((widget ajax-widget-component))
+;;;;  (<:as-is "<!-- component based javascript goes here -->")
+  )
+
+;; (defmethod render ((widget ajax))
+;;   (<:div :class "component" :id (ucw::widget-component.css-id)
+;; 	 "Hey look at me!"))
}

[ajax event base
evrim@core.gen.tr**20060506223116] {
hunk ./src/components/ajax/event.lisp 1
+(in-package :it.bese.ucw)
+
+(defmacro callback-name (name)
+  `(intern (format nil "JS-CALLBACK-~A" (string-upcase ,name)) (find-package 'it.bese.ucw)))
+
+(defmacro defserver-callback (name args &body body)
+  `(progn
+     (defaction ,name ,args ,@body)
+     (defgeneric ,(callback-name name) (comp id action-url))
+     (defmethod ,(callback-name name) (,(car args) id action-url)
+       `(lambda (invocation)
+	  (dj_debug "calling server action")
+       	  (dj_debug "EVENT IS:" (aref invocation.args 0))
+	  (dj_debug "this is:" this)
+	  (server.io.load-component ,action-url 
+				    (if (= "FORM" (slot-value ($ ,id) 'node-name))
+					($ ,id)))
+	  (dj_debug "server action ended.")
+;;;	  (event.stop-propagation)
+	  (return false)))))
+
+(defmacro defclient-callback (name args &body body)
+  `(progn
+     (defgeneric ,(callback-name name) (comp id action-url))
+     (defmethod ,(callback-name name) (,(car args) id action-url)
+       (declare (ignorable action-url))
+       `(lambda ()
+	  (progn
+	    ,@',body)))))
+
+(defmacro call-server (action)
+  (let ((action-url (action-href-body (:component (cadr action))
+		      action)))
+    `((lambda ()
+	(dj_debug "calling server action.")
+	(server.io.load-component ,action-url)
+	(dj_debug "server action ended.")))))
+
+(defmacro event-connect (component element-id event-name action)
+  `(let* ((component ,component)
+	  (action-url (action-href-body (:component ,component)
+			,action))
+	  (js-function (funcall (callback-name ',(car action))
+				,component
+				,element-id
+				action-url))
+	  (target-obj (js-component-id component))
+	  (fun-name (gen-js-name :prefix "callback_")))
+     (<:as-is
+      ~%
+      (js:js*
+       `(setf (slot-value ,target-obj ,(js-to-string fun-name)) 
+	      ,js-function)
+       `(server.event.register-event ,(slot-value ,component 'ucw::css-id)
+				     (create :element-id ,,element-id
+					     :advice-type "around"
+					     :src-func ,',event-name
+					     :target-obj ,target-obj
+					     :target-func ,(js-to-string fun-name)
+;;					     :advice-func ,js-function
+					     :is-connected nil)))
+      ~%)))
}

[ajax special fx
evrim@core.gen.tr**20060506223154] {
hunk ./src/components/ajax/fx.lisp 1
+(in-package :it.bese.ucw)
+
+(defcomponent fx-file (window-component)
+  ())
+
+(defmethod render ((comp fx-file))
+  (<:as-is
+   (js:js*
+    `(dojo.require "dojo.fx.html")
+;;;    `(setf dj-config.is-debug t)
+    `(setf fx
+	   (create
+	    :duration 200
+	    :around-server-io-parse-html
+	    (lambda (invocation)
+      	      (dj_debug "fading now.")
+	      (setf id (aref invocation.args 0))
+	      (dojo.fx.html.fade-out ($ id)
+				     this.duration
+				     (lambda (node anim)
+				       (invocation.proceed)
+				       (dojo.fx.html.fade-in node this.duration))))
+	    :before-server-io-load-component
+	    (lambda ()
+;;;	      (dj_debug "before server io load comp")
+	      (setf loading-div ($ "loading"))
+	      (when loading-div
+		(dojo.html.place-on-screen-point loading-div 0 0)
+		(setf (slot-value (slot-value loading-div 'style) 'display) "block")))
+	    :before-server-io-parse-result
+	    (lambda ()
+;;;	      (dj_debug "before server io parse result")
+	      (setf loading-div ($ "loading"))
+	      (when loading-div
+		(setf (slot-value (slot-value loading-div 'style) 'display) "none")))))
+    `(if dojo.render.html.ie
+	 (dojo.event.kw-connect 
+	  (create
+	   :type "around"
+	   :src-obj server.io
+	   :src-func "parseHtml"
+	   :target-obj fx
+	   :target-func "aroundServerIoParseHtml")))
+    `(dojo.event.kw-connect
+      (create
+       :type "before"
+       :src-obj server.io
+       :src-func "loadComponent"
+       :target-obj fx
+       :target-func "beforeServerIoLoadComponent"))
+    `(dojo.event.kw-connect
+      (create
+       :type "before"
+       :src-obj server.io
+       :src-func "parseResult"
+       :target-obj fx
+       :target-func "beforeServerIoParseResult"))
+    `(dojo.add-on-load
+      (lambda ()
+	(dojo.fx.html.fade-show document.body fx.duration))))))
}

[ajax js stack
evrim@core.gen.tr**20060506223341] {
hunk ./src/components/ajax/js.lisp 1
-
+(in-package :it.bese.ucw)
+
+(defcomponent js-debug-file (window-component)
+  ())
+
+(js::defjsmacro $ (id)
+  `(document.get-element-by-id ,id))
+
+(js::defmacro doc-body ()
+  `(aref (document.get-elements-by-tag-name "body") 0))
+
+;; (defparameter *dojo-debug* nil)
+
+;; (js::defmacro dj_debug (&rest rest)
+;;   `(if *dojo-debug*
+;;       (dj_debug ,rest)
+;;       nil))
+
+(defmethod render ((comp js-debug-file))
+  (<:as-is
+   (js:js*
+    `(defun dump-stylesheets ()
+       (setf styles (document.get-elements-by-tag-name "style"))
+       (dolist (item styles)
+	 (if (and (slot-value item 'style-sheet)
+		  (slot-value (slot-value item 'style-sheet) 'css-text))
+	     (dj_debug "ie style: " (slot-value (slot-value item 'style-sheet) 'css-text))
+	     (dj_debug "gecko style: " (slot-value item 'inner-h-t-m-l)))))
+    `(defun dump-scripts ()
+       (setf scripts (document.get-elements-by-tag-name "script"))
+       (dolist (item scripts)
+	 (dj_debug "script found:")
+	 (if (slot-value item 'src)
+	     (dj_debug "src: " (slot-value item 'src))
+	     (dj_debug "innerHTmL:" (slot-value item 'inner-h-t-m-l))))))))
+
+
+
+(defcomponent js-file (window-component)
+  ())
+
+(defmethod render ((comp js-file))
+  (<:as-is
+   (js:js*
+    `(dojo.require "dojo.io.*")
+    `(dojo.require "dojo.event.*")
+    `(dojo.require "dojo.html") 
+    `(defun noop ()
+       (return nil))   
+    `(setf server
+	   (create
+	    :io
+	    (create
+	     :load-component
+;;;; This function loads the url over ajax and sends the 
+;;;; result to parseResult() for evaluation.
+	     (lambda (url form)
+	       (dojo.io.bind (create :url url
+			:load (lambda (evt data)
+				(server.io.parse-result data))
+			:prevent-cache t
+			:form-node form)))
+	     :parse-result
+;;;; This function parses ajax response and calls specific
+;;;; loading functions. Ajax response is:
+;;;; <div class="component" id="dynamic-component-id">
+;;;;   <div class="html">
+;;;;     HTML Content rendered by render-html
+;;;;   </div>
+;;;;   <div class="css" id="dynamic-style-index">
+;;;;     CSS Content rendered by render-css
+;;;;   </div>
+;;;;   <div class="javascript">
+;;;;     Javascript Content rendered by render-javascript
+;;;;   </div>
+;;;; </div>
+;;;; <div class="component" id="next-component-id">
+;;;; .... similar to above
+;;;; </div>
+;;;; Ajax response is created by refresh-coretal-component action.
+	     (lambda (result)
+	       (dj_debug "got data:" result)
+;;;;	 (dj_debug (slot-value (document.get-elements-by-tag-name "*") 'length)))
+	       (setf root (document.create-element "div"))
+	       (setf root.inner-h-t-m-l result)
+	       (dj_debug "len: "  (slot-value (slot-value root 'child-nodes) 'length))
+	       (setf body (aref (document.get-elements-by-tag-name "body") 0))
+	       (dolist (item (slot-value root 'child-nodes))
+		 (try (this.parse-component item)
+		      (:catch (error)
+			(dj_debug "got error:" error))))
+	       (dj_debug "ended parse-result"))
+	     :parse-component
+;;;; This function parses any <div class="component"></div> and loads
+;;;; the data into current document.
+	     (lambda (item)
+	       (setf clazz (dojo.html.get-class item))
+	       (if (not (= "component" clazz))
+		   (return nil))
+	       (setf id (dojo.html.get-attribute item "id"))
+	       (dj_debug "clazz: " clazz "id: " id)
+	       (dj_debug "new: " (slot-value item 'inner-h-t-m-l))
+	       (dolist (sub-item (slot-value item 'child-nodes))
+		 (setf sub-clazz (dojo.html.get-class sub-item))
+		 (if (= "html" sub-clazz)
+		     (this.parse-html id sub-item))
+		 (if (= "css" sub-clazz)
+		     (this.parse-css id sub-item))
+		 (if (= "javascript" sub-clazz)
+		     (this.parse-javascript id sub-item)))
+	       (dj_debug "ended parsing component..."))
+	     :parse-javascript
+;;;; This function parses <div class="javascript"></div>
+;;;; html element and loads js into current document via modifying browsers
+;;;; script cache. Events are disconnect during this operation and reconnected
+;;;; afterwards.	     
+	     (lambda (id item)
+	       (setf new-js (slot-value (slot-value item 'first-child) 'inner-h-t-m-l))
+	       (dj_debug "parse-js= id:" id ", new js:" js)
+	       (when new-js
+		 (server.event.disconnect-by-component id)
+		 (server.event.unregister-events id)
+		 (dj_eval new-js)
+		 (server.event.connect-by-component id)))
+	     :parse-css
+;;;; This function parses <div class="css" id="dynamic-style-index"></div>
+;;;; html element and loads css into current document via modifying browsers
+;;;; style cache.
+	     (lambda (id item)
+	       (setf css-index (dojo.html.get-attribute item "id"))
+	       (dj_debug "parse-css= id: " id ", item: " item ", css-index:" css-index)
+
+;;;; work-around for IE, it has "v\:* { BEHAVIOUR: url(#default#VML) }" 
+;;;; <style/> element by default. (tested this with IE6 -evrim)
+;;;; unfortunately, this is added by dojo in hostenv_browser.js
+;;;; and afaik, there is no way to avoid. -evrim.
+;;;	       (if dojo.render.html.ie
+;;;	       (setf css-index (+ 1 css-index)))
+       
+	       (setf old-style (aref (document.get-elements-by-tag-name "style") css-index))
+	       (setf new-style (slot-value item 'first-child))
+	       (setf head (aref (document.get-elements-by-tag-name "head") 0))
+	       (.replace-child head new-style old-style))
+	     :parse-html
+;;;; This function parses <div class="html></div> and loads html content
+;;;; into current document via altering innerHTML property of the HTML 
+;;;; element. Event callbacks are temporarily disconnected to avoid
+;;;; memory leak in IE.
+	     (lambda (id item)
+	       (dj_debug "parse-html= id: " id "item:" item)
+	       (setf current (document.get-element-by-id id))
+	       (if current
+		   (progn
+		     (server.event.disconnect-by-component id)
+		     (setf (slot-value current 'inner-h-t-m-l) (slot-value item 'inner-h-t-m-l))
+		     (server.event.connect-by-component id))
+		   (dj_debug "not implemented in parse-html!"))))
+	    :event
+	    (create
+	     :events (make-array)
+	     :register-event
+	     (lambda (component-id event-object)
+	       (dj_debug "adding event to: " component-id ", event-object: " event-object)
+	       (if (not (slot-value this.events component-id))
+		   (setf (slot-value this.events component-id) (make-array)))
+	       (.push (slot-value this.events component-id)
+		      event-object)
+	       (if (and (not event-object.src-obj)
+			($ event-object.element-id))
+		   (setf event-object.src-obj ($ event-object.element-id))))
+	     :unregister-events
+	     (lambda (component-id)
+	       (dj_debug "removing events for component: " component-id)
+	       (if (not (slot-value this.events component-id))
+		   (return nil))
+	       (delete (slot-value this.events component-id)))
+	     :connect
+	     (lambda (event-object)
+	       (if (not ($ event-object.element-id))
+		   (return nil))
+	       
+	       (if (or (not event-object.src-obj)
+		       (not (= event-object.src-obj ($ event-object.element-id))))
+		   (setf event-object.src-obj ($ event-object.element-id)))
+	       
+	       (dj_debug "connecting event: target-id:" event-object.element-id
+			 ",object (srcObj): " event-object.src-obj
+			 ",event (srcFunc): " event-object.src-func
+			 ",callback (targetFunc): " event-object.target-func
+			 ",isConnected: " event-object.is-connected)
+	       
+	       (if event-object.src-obj
+		   (progn
+		     (dojo.event.kw-connect event-object)
+		     (setf event-object.is-connected t))
+		   (dj_debug "cannot connect, element not found: " event-object.element-id)))
+	     :disconnect
+	     (lambda (event-object)
+	       (if (not ($ event-object.element-id))
+		   (return nil))
+	       
+	       (dj_debug "disconnecting event: target-id:" event-object.element-id
+			 ",object (srcObj): " event-object.src-obj
+			 ",event (srcFunc): " event-object.src-func
+			 ",callback (targetFunc): " event-object.target-func
+			 ",isConnected: " event-object.is-connected)
+	       
+	       (if (and event-object.is-connected (= ($ event-object.element-id) event-object.src-obj))
+		   (progn
+		     (dojo.event.kw-disconnect event-object)
+		     (setf event-object.is-connected nil))
+		   (dj_debug "cannot disconnect, element-not-found: " event-object.element-id)))
+	     :connect-by-event-list
+	     (lambda (event-list)
+	       (dj_debug "connect-by-event-list, event-list: " event-list)
+	       (if (= nil event-list)
+		   (return nil))
+
+	       (dolist (item event-list)
+		 (dj_debug "item: " item)
+		 (this.connect item)))
+	     :disconnect-by-event-list
+	     (lambda (event-list)
+	       (dj_debug "disconnect-by-event-list, event-list: " event-list)
+	       (if (= nil event-list)
+		   (return nil))
+
+	       (dolist (item event-list)
+		 (dj_debug "item: " item)
+		 (this.disconnect item)))
+	     :connect-by-component
+	     (lambda (id)
+	       (dj_debug "connecting component: " id)
+;;;; connceting descendants first
+	       (when ($ id)
+		 (doeach (component this.events)
+			 (when (server.dom.is-descendant-of ($ component) ($ id))
+			   (dj_debug component " is descendant of " id)
+			   (this.connect-by-event-list (slot-value this.events component))))
+		 (this.connect-by-event-list (slot-value this.events id))))
+	     :disconnect-by-component
+	     (lambda (id)
+	       (dj_debug "disconnect component: " id)
+;;;; disconnect descendants first
+	       (when ($ id)
+		 (doeach (component this.events)
+			 (when (server.dom.is-descendant-of ($ component) ($ id))
+			   (dj_debug component " is descendant of " id)
+			   (this.disconnect-by-event-list (slot-value this.events component))))
+		 (this.disconnect-by-event-list (slot-value this.events id))))
+	     :connect-events-on-load
+	     (lambda ()
+	       (dj_debug "connect-events-onload")
+	       (doeach (item this.events)
+		       (dj_debug "item:" item)
+		       (this.connect-by-event-list (slot-value this.events item))))
+	    :disconnect-events-on-unload
+	    (lambda () 
+	      (dj_debug "disconnect-events-on-unload")
+	      (doeach (item this.events)
+		      (dj_debug "item:" item)
+		      (this.disconnect-by-event-list (slot-value this.events item)))))
+	    :dom
+	    (create
+	     :is-descendant-of
+	     (lambda (child parent)
+	       (if (or (= null child)
+		       (= null parent))
+		   (return false))
+	       
+	       (if (= child parent)
+		   (return false))
+	       
+	       (return (or (= parent child.parent-node)
+			   (this.is-descendant-of child.parent-node parent)))))))
+    `(dojo.add-on-load
+      (lambda ()
+	(dj_debug "loading events...")
+	(server.event.connect-events-on-load)	
+;; 	(dojo.event.connect
+;; 	 (aref (document.get-elements-by-tag-name "body") 0) "onunload"
+;; 	 ,(js-to-string 'server.event.disconnect-events-on-unload))
+	)))))
}

[ajax loading window sample for long dojo loading time.
evrim@core.gen.tr**20060506223433] {
hunk ./src/components/ajax/loading.lisp 1
-
+(in-package :it.bese.ucw)
+
+(defparameter +is-dojo-loaded-session-key+
+  '%is-dojo-loaded%
+  "Session key for loading dojo")
+
+(defcomponent ajax-loading (window-component)
+  ()
+  (:documentation "Ajax loading component. used to say user: hey wait dojo is loading."))
+
+(defmethod render ((self ajax-loading))
+  (<:html
+   (<:head
+    (<:title "Coretal loading..."))
+   (<:body
+    :onload (js:js-inline*
+	     `(window.location.replace ,(action-href-body (:component self)
+							  (dojo-loaded)
+ 							  (answer nil))))
+	   
+	   :style "background-color: #000000;"
+	   (<:table :width "100%"
+	    (<:tr
+	     (<:td :align "center"
+	      (<:img :src "http://coretal.core.gen.tr/images/loading/loading.gif"
+		     :alt "Coretal loading, please wait .."
+;;;		     :style "position:absolute; display:block; margin:auto;"
+		     ))))
+	   (<:script :src *dojo-url*
+		     :type "text/javascript")
+	   (<:script :src "/js.core"
+		     :type "text/javascript")
+	   (<:script :src "/fx.core"
+		     :type "text/javascript"))))
+
+(defun is-dojo-loaded (&optional (session (ucw::context.session *context*)))
+  (get-session-value +is-dojo-loaded-session-key+ nil session))
+
+(defun dojo-loaded (&optional (session (ucw::context.session *context*)))
+  (setf (get-session-value +is-dojo-loaded-session-key+ nil session) t))
+
+(defmethod/cc call-component :before ((from t) (to simple-ajax-window))
+	      (if (not (is-dojo-loaded))
+		  (call-as-window 'ajax-loading)))
+
+;; (defentry-point "loading.core" (:application *meta-coretal-application*) ()
+;;   (call 'ajax-loading))
}

[ajax pager component, similar-to-range-view
evrim@core.gen.tr**20060506223511] {
hunk ./src/components/ajax/pager.lisp 1
-
+(in-package :it.bese.ucw)
+
+;;; abstract pager component
+(defcomponent pager (ajax-widget-component)
+  ((per-page :initform 10
+	     :initarg :per-page
+	     :accessor pager.per-page
+	     :documentation "Items per page to be displayed")
+   (link-count :initform 10
+	       :accessor pager.link-count
+	       :initarg link-count
+	       :documentation "Links per page to be displayed")
+   (data :accessor pager.data
+	 :initarg :data
+	 :initform '()
+	 :documentation "List of items to be displayed bi render-list-item")
+   (current-page :initform 1
+		 :accessor current-page)
+   (item-count :initform 0
+	       :accessor item-count)
+   (number-of-pages :initform 0
+		    :accessor number-of-pages)))
+
+(defgeneric render-list-item (pager item offset)
+  (:documentation "Default method to override to render a list item. 
+Offset is from current-link-start-offset"))
+
+;;; implementation
+(defmethod shared-initialize :after ((self pager) slot-name
+				     &key &allow-other-keys)
+  (when (listp (pager.data self))
+    (setf (item-count self) (length (pager.data self))
+	  (number-of-pages self) (1+ (floor (/ (item-count self) (pager.per-page self)))))))
+
+(defmethod (setf pager.data) :after (new-data (self pager))
+  (when (listp (pager.data self))
+    (setf (item-count self) (length (pager.data self))
+	  (number-of-pages self) (1+ (floor (/ (item-count self) (pager.per-page self)))))))
+
+(defgeneric current-link-start-offset (pager))
+
+(defmethod current-link-start-offset ((self pager))
+  (loop
+     for i from (1- (current-page self)) downto 1
+     do
+       (when (zerop (rem i (pager.link-count self)))
+	 (return-from current-link-start-offset (1+ i))))
+  1)
+
+(defgeneric render-links (pager))
+
+(defmethod render-links ((self pager))
+  (with-slots (per-page current-page item-count number-of-pages) self
+    (if (eq current-page 1)
+	(<:as-html "|<")
+	(<ucw:a :action (scroll-to-page self 1)
+		:id "scroll-start"
+		(<:as-html "|<")))
+    (<:as-html " ")
+    
+    (if (= current-page 1)
+	(<:as-html "<")
+	(<ucw:a :action (scroll-to-page self (1- (current-page self)))
+		:id "scroll-backward"
+		(<:as-html "<")))
+    (<:as-html " ")
+
+    (let* ((start (current-link-start-offset self))
+	   (end-pager (+ start (1- (pager.link-count self))))
+	   (end (if (> end-pager number-of-pages)
+		    number-of-pages
+		    end-pager)))
+      (loop
+	 for i from start to end
+	 for j from 1
+	 do
+	 (if (eq current-page i)
+	     (<:as-html i " ")
+	     (let ((i i)
+		   (j j))
+	       (<ucw:a :action (scroll-to-page self i)
+		       :id (format nil "page-~A" j)
+		       (<:as-html i " "))))))
+      
+    (if (= current-page number-of-pages)
+	(<:as-html ">")
+	(<ucw:a :action (scroll-to-page self (1+ (current-page self)))
+		:id "scroll-forward"
+		(<:as-html ">")))
+    (<:as-html " ")
+
+    (if (= current-page number-of-pages)
+	(<:as-html ">|")
+	(<ucw:a :action (scroll-to-page self (number-of-pages self))
+		:id "scroll-end"
+		(<:as-html ">|")))
+    (<:as-html " ")))
+
+(defaction scroll-to-page ((self pager) to-page)
+  (when (and (> to-page 0) (<= to-page (number-of-pages self)))
+    (setf (current-page self) to-page)))
+
+;;; ajax
+(defserver-callback scroll-to-page-ajax ((self pager) to-page)
+  (scroll-to-page self to-page)
+  (refresh-ajax-component self t nil t))
+
+(defmethod render-javascript ((self pager))
+  (event-connect self "scroll-start" "onclick"
+		 (scroll-to-page-ajax self 1))
+  (event-connect self "scroll-backward" "onclick"
+		 (scroll-to-page-ajax self (1- (current-page self))))
+  (event-connect self "scroll-end" "onclick"
+		 (scroll-to-page-ajax self (number-of-pages self)))
+  (event-connect self "scroll-forward" "onclick"
+		 (scroll-to-page-ajax self (1+ (current-page self))))
+  
+  (let* ((start (current-link-start-offset self))
+	 (end-pager (+ start (1- (pager.link-count self)))))
+    (loop
+       for i from start to end-pager
+       for j from 1
+       do
+       (let ((i i)
+	     (j j))
+	 (event-connect self (format nil "page-~A" j) "onclick"
+			(scroll-to-page-ajax self i))))))
+
+(defmethod render ((self pager))
+  (loop
+     for item in (nthcdr (* (pager.per-page self) (1- (current-page self))) (pager.data self))
+     for i from 1 to (pager.per-page self)
+     do
+       (render-list-item self item i))
+  (when (> (number-of-pages self) 1)
+    (render-links self)))
}

[ajax window
evrim@core.gen.tr**20060506223604] {
hunk ./src/components/ajax/window.lisp 1
+(in-package :it.bese.ucw)
+
+;; this should be defined somewhere else?
+(defvar *dojo-url* "/dojo/dojo.js")
+
+(defcomponent simple-ajax-window (window-component)
+  ((rendered-components :accessor rendered-components
+			:initarg :rendered-components
+			:initform '())
+   (title :accessor window-component.title
+	  :initarg :title
+	  :initform nil)
+   (stylesheet :accessor window-component.stylesheet
+	       :initarg :stylesheet
+	       :initform nil)
+   (debug :accessor window-component.debug
+	  :initarg :debug
+	  :initform nil)
+   (animation :accessor window-component.animation
+	      :initarg :animation
+	      :initform t))
+  (:documentation "Simple ajax window"))
+
+;;;; This method is a wrapper for render. The main problem
+;;;; is, to generate valid HTML, <style/> and <script/> (?)
+;;;; tags must be inside <head>. 
+;;;;
+;;;; If we do not know which components are going to be rendered
+;;;; (ie. first time rendering), (rendered-components coretal-window)
+;;;; is empty. So what it does is, simply calls and caches the result
+;;;; of render method. Component render method also has a wrapper
+;;;; which caches current component into (rendered-components coretal-window). 
+;;;;
+;;;; So, now since we know the components, we can call custom render
+;;;; methods to insert styles (css) and scripts (javascript) into
+;;;; <head>. Afterwards, it pushes the render result to html-stream
+;;;; of the context which forms the <body>.
+;;;;
+;;;; Second time, since we know the components, we can call style
+;;;; and script rendering functions directly.
+(defmethod render :wrapping ((window simple-ajax-window))
+  (let ((temp-output))
+    ;;;; run render method and cache the components rendered
+    ;;;; in order to be able to call render-css. -evrim.
+    (if (null (rendered-components window))
+	(let ((temp-stream (make-string-output-stream)))
+	  (ucw::with-yaclml-stream temp-stream temp-stream
+				   (call-next-method) 
+				   (setf temp-output
+					 (get-output-stream-string temp-stream)))))
+    
+    (<:as-is "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/transitional.dtd\">"
+	   #\Newline)
+    (<:html
+     (<:head
+      (<:meta :http-equiv "Content-Type" :content (ucw::window-component.content-type window))
+      (<:title (<:as-html (window-component.title window)))
+
+      ;;;; iterate over component list to render css
+      ;;;; warning: dojo adds hidden stylesheets,
+      ;;;; so, never render styles after dojo.js.
+      (dolist (item (rendered-components window))
+	(render-css item))
+      
+      (<:script :src *dojo-url* :type "text/javascript")
+      
+      
+      (when (window-component.debug window)
+	(<ucw:script
+	 `(setf dj-config.is-debug t))
+	(<:script :src "/js-debug.core" :type "text/javascript"))
+
+      (<:script :src "/js.core" :type "text/javascript")
+
+      ;;; session updater
+      (<ucw:script
+        `(dojo.add-on-load
+	  (lambda ()
+	    (set-interval
+	     (lambda ()
+		(server.io.load-component ,(action-href-body (:component window)
+							     (refresh-component window)
+							     (setf (ucw::context.done *context*) t))))
+	     (* 5 60 1000))))) ;;refresh session every 5 min
+      
+      (when (window-component.animation window)
+	(<:script :src "/fx.core" :type "text/javascript"))
+      
+      ;;;; iterate over component list to render javascripts
+      (dolist (item (rendered-components window))
+	(render-javascript item))
+
+      ;;;; external stylesheet to override any component specific
+      ;;;; style
+      (dolist (stylesheet (ensure-list (window-component.stylesheet window)))
+	(<:link :rel "stylesheet"
+		:href stylesheet
+		:type "text/css")))
+
+     (<:body :style (if (window-component.animation window)
+			"display: none;"
+			"display: block;")
+;;;; if we've already run render, just append the output to html-stream
+;;;; otherwise, run usual render method.
+      (if temp-output
+	  (write-string temp-output (html-stream (ucw::context.response *context*)))
+	  (call-next-method))
+      
+      (<:div :id "loading"
+	     :style
+	     "display: none; position: absolute;
+width: 100%; color: #FFFFFF; background-color: #000000;
+text-align: center; font-weight: bold; padding: 2px;"
+	     (<:as-html "Loading..."))))))
+
+(defmethod css-index ((window simple-ajax-window) comp)
+  (position comp (rendered-components window)))
+
}

[- added ajax examples link to examples index.ucw
evrim@core.gen.tr**20060507014434] {
hunk ./examples/examples.lisp 73
+	(<:li (<:a :href "/ajax/index.ucw" "Ajax Examples"))
}

[- render omiting context.done patch for handle-action-as-ucw-action
evrim@core.gen.tr**20060508000219] {
hunk ./src/rerl/standard-dispatcher.lisp 278
-  (render-loop (frame.window-component (context.current-frame *context*)))
+  (when (not (context.done *context*))
+    (render-loop (frame.window-component (context.current-frame *context*))))
}

[- done slot added to standard-request-context for ajax.
evrim@core.gen.tr**20060508000235] {
hunk ./src/rerl/standard-classes.lisp 57
-   (action      :accessor context.action      :initarg :action)))
+   (action      :accessor context.action      :initarg :action)
+   (done :accessor context.done :initarg :done :initform nil
+	 :documentation "Used by ajax, see handle-action-as-ucw-action & refresh-ajax-component")))
}

[- ajax examples added to :ucw.examples asdf system.
evrim@core.gen.tr**20060508071334] {
hunk ./ucw.asd 148
-			       (:file "sum" :depends-on ("examples")))))
+			       (:file "sum" :depends-on ("examples"))
+			       (:module :ajax
+					:serial t
+					:depends-on ("examples")
+					:components
+					((:file "entry-points")
+					 (:file "example1")
+					 (:file "example2")
+					 (:file "example3")
+					 (:file "example4"))))))
}

[- ajax exports for it.bese.ucw package
evrim@core.gen.tr**20060508071755] {
hunk ./src/packages.lisp 290
-   ;; Ajax stuff
+   ;; dojo-url
hunk ./src/packages.lisp 293
+   ;; ajax
hunk ./src/packages.lisp 302
+   ;; component
+   #:ajax-widget-component
+   #:render-javascript
+   #:render-css
+   
+   ;;window
+   #:simple-ajax-window
+   #:window-component.debug
+   #:window-component.animation
+
+   ;;js stack
+   #:js-file
+   #:js-debug-file
+   #:fx-file
+   
}

[- gen-js-name -> js:gen-js-name
evrim@core.gen.tr**20060508071852] {
hunk ./src/components/ajax/event.lisp 48
-	  (fun-name (gen-js-name :prefix "callback_")))
+	  (fun-name (js:gen-js-name :prefix "callback_")))
}

[- url extension reverted to .ucw
evrim@core.gen.tr**20060508071926] {
hunk ./src/components/ajax/window.lisp 4
-(defvar *dojo-url* "/dojo/dojo.js")
+;;;(defvar *dojo-url* "/dojo/dojo.js")
+(defvar *dojo-url* "http://coretal.core.gen.tr/dojo/dojo.js")
hunk ./src/components/ajax/window.lisp 72
-	(<:script :src "/js-debug.core" :type "text/javascript"))
+	(<:script :src "/js-debug.ucw" :type "text/javascript"))
hunk ./src/components/ajax/window.lisp 74
-      (<:script :src "/js.core" :type "text/javascript")
+      (<:script :src "/js.ucw" :type "text/javascript")
hunk ./src/components/ajax/window.lisp 88
-	(<:script :src "/fx.core" :type "text/javascript"))
+	(<:script :src "/fx.ucw" :type "text/javascript"))
}

[ajax entry points for *example-application*
evrim@core.gen.tr**20060508071957] {
adddir ./examples/ajax
addfile ./examples/ajax/entry-points.lisp
hunk ./examples/ajax/entry-points.lisp 1
+(in-package :it.bese.ucw-user)
+
+(defentry-point "js.ucw" (:application *example-application*) ()
+  (call-as-window 'js-file))
+
+(defentry-point "js-debug.ucw" (:application *example-application*) ()
+  (call 'js-debug-file))
+
+(defentry-point "fx.ucw" (:application *example-application*) ()
+  (call 'fx-file))
}

[- Ajax Test Window #1 - Multiple Components, Multiple Component Controller
evrim@core.gen.tr**20060508072142] {
addfile ./examples/ajax/example1.lisp
hunk ./examples/ajax/example1.lisp 1
+(in-package :it.bese.ucw-user)
+
+(defcomponent ajax-test-component (ajax-widget-component)
+  ((color :initform "#cc0000")
+   (text :initform "hey i'm a component!"))
+  (:default-initargs :css-class "test-component"))
+
+(defmethod render ((comp ajax-test-component))
+  (<:as-html (slot-value comp 'text))
+  (<:p (<:input :type "button"
+		:id (concatenate 'string "button-" (slot-value comp 'ucw::css-id))
+		:value "im a button, click me!")))
+	
+(defmethod render-css ((comp ajax-test-component))
+  (<:style :type "text/css"
+	   (<:as-is "div." (ucw::widget-component.css-class comp) "#" (ucw::widget-component.css-id comp) " { "
+		    "color: " (slot-value comp 'color)
+		    "; }")))
+
+(defmethod render-form ((comp ajax-test-component))
+  (<:form :action "no not used."
+	     (<:input :type "button"
+		      :value "change text"
+		      :id (concatenate 'string "change-text-" (slot-value comp 'ucw::css-id)))
+	     (<:input :type "button"
+		      :value "change color"
+		      :id (concatenate 'string "change-color-" (slot-value comp 'ucw::css-id)))
+	     (<:input :type "button"
+		      :value "change both"
+		      :id (concatenate 'string "change-both-" (slot-value comp 'ucw::css-id)))))
+
+(defserver-callback test-action ((comp ajax-test-component) text color)
+  (when text 
+    (if (equal (slot-value comp 'text) "hey i'm a component!")
+	(setf (slot-value comp 'text) "hey, i'm new now!")
+	(setf (slot-value comp 'text) "hey i'm a component!")))
+  (when color
+    (if (equal (slot-value comp 'color) "#cc0000")
+	(setf (slot-value comp 'color) "#336699")
+	(setf (slot-value comp 'color) "#cc0000")))
+  (refresh-ajax-component comp text color nil))
+
+(defmethod render-javascript ((comp ajax-test-component))
+  (event-connect comp
+		 (concatenate 'string "change-text-" (slot-value comp 'ucw::css-id))
+		 "onclick"
+		 (test-action comp t nil))
+  (event-connect comp
+		 (concatenate 'string "change-color-" (slot-value comp 'ucw::css-id))
+		 "onclick"
+		 (test-action comp nil t))
+  (event-connect comp
+		 (concatenate 'string "change-both-" (slot-value comp 'ucw::css-id))
+		 "onclick"
+		 (test-action comp t t)))
+
+(defcomponent test1 (ajax-test-component)
+  ()
+  (:default-initargs :css-id "test1"))
+
+(defcomponent test2 (ajax-test-component)
+  ()
+  (:default-initargs :css-id "test2"))
+
+(defserver-callback server-callback1 ((comp test2))
+    (setf (slot-value comp 'text) "server-callback1 is called.")
+    (refresh-ajax-component comp t nil nil))
+
+(defclient-callback client-callback1 (event)
+  (alert "client-callback1 is called."))
+
+(defmethod render-javascript ((comp test1))
+  (call-next-method)
+  (event-connect comp "button-test1" "onclick" (client-callback1 comp)))
+
+(defmethod render-javascript ((comp test2))
+  (call-next-method)
+  (event-connect comp "button-test2" "onclick" (server-callback1 comp)))
+
+(defcomponent multiple-controller (ajax-widget-component)
+  ())
+
+(defserver-callback test-action2 ((self multiple-controller) text color)
+  (let ((comp1 (slot-value (context.window-component *context*) 'comp1))
+	(comp2 (slot-value (context.window-component *context*) 'comp2)))
+    (test-action comp1 text color)
+    (test-action comp2 text color)))
+
+(defmethod render ((self multiple-controller))
+  (<:tr
+   (<:td :colspan 2 :align "center"
+	 (<:form :action "no not used."
+		    (<:input :type "button"
+			     :value "change text"
+			     :id "change-text")
+		    (<:input :type "button"
+			     :value "change color"
+			     :id "change-color")
+		    (<:input :type "button"
+			     :value "change both"
+			     :id "change-both")))))
+
+(defmethod render-javascript ((self multiple-controller))
+  (event-connect self "change-text" "onclick" (test-action2 self t nil))
+  (event-connect self "change-color" "onclick" (test-action2 self nil t))
+  (event-connect self "change-both" "onclick" (test-action2 self t t)))
+
+(defcomponent test-window (simple-ajax-window)
+  ((comp1 :component test1)
+   (comp2 :component test2)
+   (multiple :component multiple-controller))
+  (:default-initargs
+      :title "Ajax Test Window #1 - Multiple Components, Multiple Component Controller"
+    :debug nil))
+
+(defentry-point "ajax/example1.ucw" (:application *example-application*) ()
+  (call 'test-window))
+
+(defmethod render ((window test-window))
+  (<:table :border 1 :width "100%"
+   (<:tr
+    (<:td :colspan 2 :align "center"
+     (<:ah "Here is multi-component test window")))
+   (<:tr
+    (<:td :align "center"
+	  (<:ah "Component 1"))
+    (<:td :align "center"
+	  (<:ah "Component 2")))
+   (<:tr
+    (<:td :align "center"
+	  (render (slot-value window 'comp1)))
+    (<:td :align "center"
+	  (render (slot-value window 'comp2))))
+   (<:tr
+    (<:td :align "center"
+	  (render-form (slot-value window 'comp1)))
+    (<:td :align "center"
+	  (render-form (slot-value window 'comp2))))
+   (<:tr 
+    (<:td :colspan 2 :align "center"
+	 (<:ah "Multiple controller:")))
+   (render (slot-value window 'multiple))))
+
}

[- Ajax Test Window #2 - Nested Components
evrim@core.gen.tr**20060508072203] {
addfile ./examples/ajax/example2.lisp
hunk ./examples/ajax/example2.lisp 1
-
+(in-package :it.bese.ucw-user)
+
+(defcomponent recursive-component (ajax-widget-component)
+  ((text :initform "recursivity test"))
+  (:default-initargs :css-class "recursive-component"))
+
+(defmethod render ((comp recursive-component))
+  (<:as-html "rendering recursive:" (ucw::widget-component.css-id comp))
+  (<:p (<:as-html (slot-value comp 'text)))
+  (<:p (<:input :type "button"
+		:id (concatenate 'string "button-" (slot-value comp 'ucw::css-id))
+		:value "button: im a button, click me!")))
+
+(defserver-callback change-text ((comp recursive-component))
+  (if (string= "recursivity test" (slot-value comp 'text))
+      (setf (slot-value comp 'text) "new recursive content")
+      (setf (slot-value comp 'text) "recursivity test"))
+  (refresh-ajax-component comp t nil nil))
+
+(defcomponent rtest1-1 (recursive-component)
+  ((callback-name :initform 'change-event-handler))
+  (:default-initargs :css-id "rtest1-1"))
+
+(defclient-callback client-callback1-1 (event)
+  (alert "this comp1-1"))
+
+(defserver-callback change-event-handler ((comp rtest1-1))
+  (if (eq (slot-value comp 'callback-name) 'change-event-handler)
+      (setf (slot-value comp 'callback-name) 'client-callback1-1)
+      (setf (slot-value comp 'callback-name) 'change-event-handler))
+
+  (if (string= "recursivity test" (slot-value comp 'text))
+      (setf (slot-value comp 'text) "new recursive content")
+      (setf (slot-value comp 'text) "recursivity test"))
+  (refresh-ajax-component comp t nil t))
+
+(defmethod render-javascript ((comp rtest1-1))
+  (if (eq (slot-value comp 'callback-name) 'change-event-handler)
+      (event-connect comp "button-rtest1-1" "onclick" (change-event-handler comp))
+      (event-connect comp "button-rtest1-1" "onclick" (client-callback1-1 comp))))
+
+(defcomponent rtest1 (recursive-component)
+  ((r1-1 :component rtest1-1))
+  (:default-initargs :css-id "rtest1"))
+
+(defclient-callback client-callback1 (event)
+  (progn
+    (dump-scripts)
+;;;    (dolist (item (slot-value server.event.events "rtest1-1"))
+;;;	    (dj_debug "event id:" item.element-id ", target obj:" item.target-obj ", target func:" item.target-func))
+;;;    (server.event.connect-by-component "rtest1-1")
+    ))
+
+(defmethod render ((comp rtest1))
+  (call-next-method)
+  (render (slot-value comp 'r1-1)))
+
+(defmethod render-javascript ((comp rtest1))
+  (event-connect comp "button-rtest1" "onclick" (change-text comp)))
+
+(defcomponent recursive-component-test-window (simple-ajax-window)
+  ((comp1 :component rtest1))
+  (:default-initargs
+    :title "Ajax Test Window #2 - Nested Components"
+    :debug nil))
+
+(defentry-point "ajax/example2.ucw" (:application *example-application*) ()
+ (call 'recursive-component-test-window))
+
+(defmethod render ((window recursive-component-test-window))
+  (<:table :border 1 :width "100%"
+	   (<:tr
+	    (<:td :align "center"
+		  (<:as-html "Recursive component test window")))
+	   (<:tr
+	    (<:td
+	     (render (slot-value window 'comp1))))))
}

[- Ajax Test Window #3 - Navigation
evrim@core.gen.tr**20060508072214] {
addfile ./examples/ajax/example3.lisp
hunk ./examples/ajax/example3.lisp 1
-
+(in-package :it.bese.ucw-user)
+
+(defparameter *contents* (list
+			  "This is content 1"
+			  "This is content 2, this is getting boring."))
+
+(defcomponent ajax-content (ajax-widget-component)
+  ((content :initarg :content
+	    :initform "Default Content"
+	    :accessor content))
+  (:default-initargs
+    :css-class "ajax-content"
+    :css-id "content"))
+
+(defmethod render ((comp ajax-content))
+  (<:ah (content comp)))
+
+(defcomponent ajax-navigation (ajax-widget-component)
+  ()
+  (:default-initargs
+    :css-class "ajax-navigation"
+    :css-id "nav"))
+
+(defmethod render ((comp ajax-navigation))
+  (<:ul
+   (dolist (item *contents*)
+     (<:li
+      (<ucw:a :action (show-content comp item)
+	      :id (format nil "content-~A" (position item *contents*))
+	      (<:ah "content no:" (position item *contents*)))))))
+
+(defserver-callback show-content ((self ajax-navigation) content)
+  (setf window (context.window-component *context*))
+  (setf content-widget (slot-value window 'content))
+  (setf (content content-widget) content)
+  (refresh-ajax-component content-widget t nil nil))
+
+(defmethod render-javascript ((comp ajax-navigation))
+  (dolist (item *contents*)
+    (event-connect comp
+		   (format nil "content-~A" (position item *contents*))
+		   "onclick"
+		   (show-content comp item))))
+
+(defcomponent coretal-window (simple-ajax-window)
+  ((nav :component ajax-navigation)
+   (content :component ajax-content :initarg :content))
+  (:default-initargs
+    :title "Ajax Test Window #3 - Navigation"
+    :debug nil))
+
+(defmethod render ((window coretal-window))
+  (<:table :width "100%" :border 1
+	   (<:tr
+	    (<:td :colspan 2 :align "center"
+		  (<:ah "Header")))
+	   (<:tr 
+	    (<:td :width "20%"
+	     (render (slot-value window 'nav)))
+	    (<:td
+	     (render (slot-value window 'content))))
+	   (<:tr
+	    (<:td :colspan 2 :align "center"
+		  (<:ah "Footer")))))
+
+
+(defun find-content (pos)
+  (handler-case 
+   (nth (parse-integer pos) *contents*)
+    (sb-int::simple-parse-error () nil)))
+
+(defentry-point "ajax/example3.ucw" (:application *example-application*)
+    (pos)
+  (aif (and pos (find-content pos))
+       (call 'coretal-window
+	     :content (make-instance 'ajax-content :content it))
+       (call 'coretal-window)))
}

[- Ajax Test Window #4 - Forms
evrim@core.gen.tr**20060508072226] {
addfile ./examples/ajax/example4.lisp
hunk ./examples/ajax/example4.lisp 1
+(in-package :it.bese.ucw-user)
+
+(defcomponent my-form (ajax-widget-component)
+  ((form-data :accessor form-data
+	      :initform "this is default value")))
+
+(defmethod render ((self my-form))
+  (<:form :id "my-form"
+	  :action (refresh-component self)
+	  :method "post"
+	  (<ucw:input :type "text"
+		      :size 40
+		      :accessor (form-data self))
+	  (<:br)
+	  (<:as-html "Current value:" (form-data self))
+	  (<:br)
+	  (<:input :type "submit"
+		   :value "post it!")))
+
+(defserver-callback refresh-my-form ((self my-form) param1)
+  (describe param1) ;;; rets SAMPLE-PARAMETER
+  (refresh-ajax-component self t nil t))
+
+(defmethod render-javascript ((self my-form))
+  (event-connect self
+		 "my-form"
+		 "onsubmit"
+		 (refresh-my-form self 'SAMPLE-PARAMETER)))
+
+(defcomponent my-window (simple-ajax-window)
+  ((core-form :component my-form
+	      :accessor core-form))
+  (:default-initargs
+    :title "Ajax Test Window #4 - Forms"
+    :debug nil))
+
+(defentry-point "ajax/example4.ucw" (:application *example-application*) ()
+  (call 'my-window))
+
+(defmethod render ((self my-window))
+  (<:as-html "Sample Form")
+  (render (core-form self)))
}

[licensed appended to ajax files.
evrim@core.gen.tr**20060508074501] {
hunk ./examples/ajax/entry-points.lisp 12
+;; Copyright (c) 2006 Evrim Ulu <evrim@core.gen.tr>
+;; All rights reserved. 
+;; 
+;; Redistribution and use in source and binary forms, with or without
+;; modification, are permitted provided that the following conditions are
+;; met:
+;; 
+;;  - Redistributions of source code must retain the above copyright
+;;    notice, this list of conditions and the following disclaimer.
+;; 
+;;  - Redistributions in binary form must reproduce the above copyright
+;;    notice, this list of conditions and the following disclaimer in the
+;;    documentation and/or other materials provided with the distribution.
+;; 
+;;  - Name of its contributors may not be used to endorse or promote products
+;;    derived from this software without specific prior written permission.
+;; 
+;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+;; A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT
+;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
hunk ./examples/ajax/example1.lisp 145
+;; Copyright (c) 2006 Evrim Ulu <evrim@core.gen.tr>
+;; All rights reserved. 
+;; 
+;; Redistribution and use in source and binary forms, with or without
+;; modification, are permitted provided that the following conditions are
+;; met:
+;; 
+;;  - Redistributions of source code must retain the above copyright
+;;    notice, this list of conditions and the following disclaimer.
+;; 
+;;  - Redistributions in binary form must reproduce the above copyright
+;;    notice, this list of conditions and the following disclaimer in the
+;;    documentation and/or other materials provided with the distribution.
+;; 
+;;  - Name of its contributors may not be used to endorse or promote products
+;;    derived from this software without specific prior written permission.
+;; 
+;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+;; A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT
+;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
hunk ./examples/ajax/example2.lisp 78
+
+
+;; Copyright (c) 2006 Evrim Ulu <evrim@core.gen.tr>
+;; All rights reserved. 
+;; 
+;; Redistribution and use in source and binary forms, with or without
+;; modification, are permitted provided that the following conditions are
+;; met:
+;; 
+;;  - Redistributions of source code must retain the above copyright
+;;    notice, this list of conditions and the following disclaimer.
+;; 
+;;  - Redistributions in binary form must reproduce the above copyright
+;;    notice, this list of conditions and the following disclaimer in the
+;;    documentation and/or other materials provided with the distribution.
+;; 
+;;  - Name of its contributors may not be used to endorse or promote products
+;;    derived from this software without specific prior written permission.
+;; 
+;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+;; A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT
+;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
hunk ./examples/ajax/example3.lisp 78
+
+
+;; Copyright (c) 2006 Evrim Ulu <evrim@core.gen.tr>
+;; All rights reserved. 
+;; 
+;; Redistribution and use in source and binary forms, with or without
+;; modification, are permitted provided that the following conditions are
+;; met:
+;; 
+;;  - Redistributions of source code must retain the above copyright
+;;    notice, this list of conditions and the following disclaimer.
+;; 
+;;  - Redistributions in binary form must reproduce the above copyright
+;;    notice, this list of conditions and the following disclaimer in the
+;;    documentation and/or other materials provided with the distribution.
+;; 
+;;  - Name of its contributors may not be used to endorse or promote products
+;;    derived from this software without specific prior written permission.
+;; 
+;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+;; A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT
+;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
hunk ./examples/ajax/example4.lisp 44
+;; Copyright (c) 2006 Evrim Ulu <evrim@core.gen.tr>
+;; All rights reserved. 
+;; 
+;; Redistribution and use in source and binary forms, with or without
+;; modification, are permitted provided that the following conditions are
+;; met:
+;; 
+;;  - Redistributions of source code must retain the above copyright
+;;    notice, this list of conditions and the following disclaimer.
+;; 
+;;  - Redistributions in binary form must reproduce the above copyright
+;;    notice, this list of conditions and the following disclaimer in the
+;;    documentation and/or other materials provided with the distribution.
+;; 
+;;  - Name of its contributors may not be used to endorse or promote products
+;;    derived from this software without specific prior written permission.
+;; 
+;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+;; A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT
+;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
hunk ./src/components/ajax/component.lisp 91
-;; (defmethod render ((widget ajax))
-;;   (<:div :class "component" :id (ucw::widget-component.css-id)
-;; 	 "Hey look at me!"))
+;; Copyright (c) 2006 Evrim Ulu <evrim@core.gen.tr>
+;; All rights reserved. 
+;; 
+;; Redistribution and use in source and binary forms, with or without
+;; modification, are permitted provided that the following conditions are
+;; met:
+;; 
+;;  - Redistributions of source code must retain the above copyright
+;;    notice, this list of conditions and the following disclaimer.
+;; 
+;;  - Redistributions in binary form must reproduce the above copyright
+;;    notice, this list of conditions and the following disclaimer in the
+;;    documentation and/or other materials provided with the distribution.
+;; 
+;;  - Name of its contributors may not be used to endorse or promote products
+;;    derived from this software without specific prior written permission.
+;; 
+;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+;; A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT
+;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
hunk ./src/components/ajax/event.lisp 64
+;; Copyright (c) 2006 Evrim Ulu <evrim@core.gen.tr>
+;; All rights reserved. 
+;; 
+;; Redistribution and use in source and binary forms, with or without
+;; modification, are permitted provided that the following conditions are
+;; met:
+;; 
+;;  - Redistributions of source code must retain the above copyright
+;;    notice, this list of conditions and the following disclaimer.
+;; 
+;;  - Redistributions in binary form must reproduce the above copyright
+;;    notice, this list of conditions and the following disclaimer in the
+;;    documentation and/or other materials provided with the distribution.
+;; 
+;;  - Name of its contributors may not be used to endorse or promote products
+;;    derived from this software without specific prior written permission.
+;; 
+;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+;; A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT
+;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
hunk ./src/components/ajax/fx.lisp 62
+;; Copyright (c) 2006 Evrim Ulu <evrim@core.gen.tr>
+;; All rights reserved. 
+;; 
+;; Redistribution and use in source and binary forms, with or without
+;; modification, are permitted provided that the following conditions are
+;; met:
+;; 
+;;  - Redistributions of source code must retain the above copyright
+;;    notice, this list of conditions and the following disclaimer.
+;; 
+;;  - Redistributions in binary form must reproduce the above copyright
+;;    notice, this list of conditions and the following disclaimer in the
+;;    documentation and/or other materials provided with the distribution.
+;; 
+;;  - Name of its contributors may not be used to endorse or promote products
+;;    derived from this software without specific prior written permission.
+;; 
+;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+;; A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT
+;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
hunk ./src/components/ajax/js.lisp 284
+
+
+;; Copyright (c) 2006 Evrim Ulu <evrim@core.gen.tr>
+;; All rights reserved. 
+;; 
+;; Redistribution and use in source and binary forms, with or without
+;; modification, are permitted provided that the following conditions are
+;; met:
+;; 
+;;  - Redistributions of source code must retain the above copyright
+;;    notice, this list of conditions and the following disclaimer.
+;; 
+;;  - Redistributions in binary form must reproduce the above copyright
+;;    notice, this list of conditions and the following disclaimer in the
+;;    documentation and/or other materials provided with the distribution.
+;; 
+;;  - Name of its contributors may not be used to endorse or promote products
+;;    derived from this software without specific prior written permission.
+;; 
+;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+;; A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT
+;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
hunk ./src/components/ajax/loading.lisp 48
+
+
+;; Copyright (c) 2006 Evrim Ulu <evrim@core.gen.tr>
+;; All rights reserved. 
+;; 
+;; Redistribution and use in source and binary forms, with or without
+;; modification, are permitted provided that the following conditions are
+;; met:
+;; 
+;;  - Redistributions of source code must retain the above copyright
+;;    notice, this list of conditions and the following disclaimer.
+;; 
+;;  - Redistributions in binary form must reproduce the above copyright
+;;    notice, this list of conditions and the following disclaimer in the
+;;    documentation and/or other materials provided with the distribution.
+;; 
+;;  - Name of its contributors may not be used to endorse or promote products
+;;    derived from this software without specific prior written permission.
+;; 
+;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+;; A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT
+;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
hunk ./src/components/ajax/pager.lisp 137
+
+
+;; Copyright (c) 2006 Evrim Ulu <evrim@core.gen.tr>
+;; All rights reserved. 
+;; 
+;; Redistribution and use in source and binary forms, with or without
+;; modification, are permitted provided that the following conditions are
+;; met:
+;; 
+;;  - Redistributions of source code must retain the above copyright
+;;    notice, this list of conditions and the following disclaimer.
+;; 
+;;  - Redistributions in binary form must reproduce the above copyright
+;;    notice, this list of conditions and the following disclaimer in the
+;;    documentation and/or other materials provided with the distribution.
+;; 
+;;  - Name of its contributors may not be used to endorse or promote products
+;;    derived from this software without specific prior written permission.
+;; 
+;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+;; A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT
+;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
hunk ./src/components/ajax/window.lisp 121
+;; Copyright (c) 2006 Evrim Ulu <evrim@core.gen.tr>
+;; All rights reserved. 
+;; 
+;; Redistribution and use in source and binary forms, with or without
+;; modification, are permitted provided that the following conditions are
+;; met:
+;; 
+;;  - Redistributions of source code must retain the above copyright
+;;    notice, this list of conditions and the following disclaimer.
+;; 
+;;  - Redistributions in binary form must reproduce the above copyright
+;;    notice, this list of conditions and the following disclaimer in the
+;;    documentation and/or other materials provided with the distribution.
+;; 
+;;  - Name of its contributors may not be used to endorse or promote products
+;;    derived from this software without specific prior written permission.
+;; 
+;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+;; A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT
+;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
}

[- cleanup
evrim@core.gen.tr**20060508074711] {
hunk ./src/components/ajax/component.lisp 88
-;;;;  (<:as-is "<!-- component based javascript goes here -->")
+  "Default method to provide component based javascript (i.e event-connect)"
}

[- cleanup
evrim@core.gen.tr**20060508074730] {
hunk ./src/components/ajax/component.lisp 63
-  "Default method to override in order to provide inline style."
-;;   (<:style :type "text/css"
-;; 	   (<:as-is "div.component#" (slot-value widget 'css-id) " { "
-;; 		    "color: #cc0000"
-;; 		    "; }"))
-  )
+  "Default method to override in order to provide inline style.")
+
}

[- cleanup
evrim@core.gen.tr**20060508074851] {
hunk ./src/components/ajax/fx.lisp 10
-;;;    `(setf dj-config.is-debug t)
hunk ./src/components/ajax/fx.lisp 24
-;;;	      (dj_debug "before server io load comp")
hunk ./src/components/ajax/fx.lisp 30
-;;;	      (dj_debug "before server io parse result")
}

[cleanup
evrim@core.gen.tr**20060508074920] {
hunk ./src/components/ajax/loading.lisp 26
-		     :alt "Coretal loading, please wait .."
-;;;		     :style "position:absolute; display:block; margin:auto;"
-		     ))))
+		     :alt "Coretal loading, please wait .."))))
}

[cleanup
evrim@core.gen.tr**20060508074942] {
hunk ./src/components/ajax/pager.lisp 3
-;;; abstract pager component
+;;; pager component
}

[- added ajax examples links to example-application
evrim@core.gen.tr**20060508095112] {
hunk ./examples/examples.lisp 73
-	(<:li (<:a :href "/ajax/index.ucw" "Ajax Examples"))
+	(<:li (<:a :href "/ajax/example1.ucw" "Ajax Test Window #1 - Multiple Components, Multiple Component Controller"))
+	(<:li (<:a :href "/ajax/example2.ucw" "Ajax Test Window #2 - Nested Components"))
+	(<:li (<:a :href "/ajax/example3.ucw" "Ajax Test Window #3 - Navigation"))
+	(<:li (<:a :href "/ajax/example4.ucw" "Ajax Test Window #4 - Forms"))
}

[- fixed css alignment bug
evrim@core.gen.tr**20060508095613] {
hunk ./src/components/ajax/component.lisp 58
-  (:documentation "The generic entry point for rendering
-  style & css that belongs to the component.")
+  (:documentation "Default method to override in order to provide component
+specific style in the form of css")
hunk ./src/components/ajax/component.lisp 62
+(defmethod render-css :wrapping ((widget ajax-widget-component))
+  (<:style :type "text/css"
+	   (call-next-method)))
+
hunk ./src/components/ajax/component.lisp 67
-  "Default method to override in order to provide inline style.")
+  )
hunk ./src/components/ajax/component.lisp 73
-  (:documentation "The generic entry point for rendering
-  event methods and other javascript code that belongs to the component.")
+  (:documentation "Default method to override in order to provide component
+specific event functionality in the form of javascript")
hunk ./src/components/ajax/component.lisp 88
-  "Default method to provide component based javascript (i.e event-connect)"
-  )
+ )
}

[- fixed css alignment bug
evrim@core.gen.tr**20060508095725] {
hunk ./src/components/ajax/window.lisp 10
-			:initform '())
+			:initform '()
+			:documentation "cache list, contains 
+components that are rendered by this window")
hunk ./src/components/ajax/window.lisp 63
-      ;;;; warning: dojo adds hidden stylesheets,
-      ;;;; so, never render styles after dojo.js.
}

[- fixed css alignment bug
evrim@core.gen.tr**20060508095748] {
hunk ./examples/ajax/example1.lisp 15
-  (<:style :type "text/css"
-	   (<:as-is "div." (ucw::widget-component.css-class comp) "#" (ucw::widget-component.css-id comp) " { "
-		    "color: " (slot-value comp 'color)
-		    "; }")))
+  (<:as-is "div." (ucw::widget-component.css-class comp) "#" (ucw::widget-component.css-id comp) " { "
+	   "color: " (slot-value comp 'color)
+	   "; }"))
hunk ./examples/ajax/example1.lisp 113
-    :debug nil))
+    :debug t))
}

[- disabled debug output for ajax-example1
evrim@core.gen.tr**20060508100120] {
hunk ./examples/ajax/example1.lisp 113
-    :debug t))
+    :debug nil))
}

Context:

[Docfix for net-telent-date dependency.
Maciek Pasternacki <maciekp@japhy.fnord.org>**20060504233324] 
[INCOMPATIBLE CHANGE: add NET-TELENT-DATE dependency, send out Date: header, make SERVE-FILE cache-friendly (use Date:, Last-Modified:, Expires: and If-Modified-Since: headers).
Maciek Pasternacki <maciekp@japhy.fnord.org>**20060503013844] 
[Don't send headers set to NIL (especially Content-Length:) in response.
Maciek Pasternacki <maciekp@japhy.fnord.org>**20060503013648] 
[New function (delete-header message header-name).
Maciek Pasternacki <maciekp@japhy.fnord.org>**20060503011904] 
[Don't send body if HTTP method is HEAD.
Maciek Pasternacki <maciekp@japhy.fnord.org>**20060502222010] 
[Save HTTP method of request as string.
Maciek Pasternacki <maciekp@japhy.fnord.org>**20060502221955] 
[Initform for (request response).
Maciek Pasternacki <maciekp@japhy.fnord.org>**20060502221939] 
[Include in httpd response a request associated with it.
Maciek Pasternacki <maciekp@japhy.fnord.org>**20060502221158] 
[changed docs to get up to date and add some info
cjstuij@gmail.com**20060503094055] 
[Added send-redirect function.
Marco Baringer <mb@bese.it>**20060501154250
 
 send-redirect does what redirect-component's render method did but
 it's usable from a simple-dispatcher (or anywhere else we don't have
 ucw's component context machinery).
] 
[Use dolist*, not dolist, in tabbed-pane's render method.
Marco Baringer <mb@bese.it>**20060501135314] 
[Using (when (whatever) T) is weird, use (whatever) instead
Marco Baringer <mb@bese.it>**20060501135000] 
[Minor indentation/whitespace fixups in src/components/form.lisp
Marco Baringer <mb@bese.it>**20060501134849] 
[make-with-dummy-request-nicer
cjstuij@gmail.com**20060501001756] 
[tabbed-pane-makeover - tabbed panes are now wrapped in divs in stead of a table, for more design flexibility. Is no longer tied to a tal file.
cjstuij@gmail.com**20060430233920] 
[Removing integer-range-validator, use number-range-validator instead.
Nathan Bird <nathan@acceleration.net>**20060428165829] 
[the value of a number-field should be nil, not 0, if nothing was entered.
Nathan Bird <nathan@acceleration.net>**20060428164949] 
[bin/ucwctl: allow a custom ucwctl.conf via -u|--ucwctl-file
Luca Capello <luca@pca.it>**20060501110031
 
 This adds the possibility to specify a different ucwctl.conf file
 instead of the default /etc/ucw/ucwctl.conf.  Moreover, by default
 ucwctl now reads ~/.ucw/ucwctl.conf it it exists, overriding the
 values in the general /etc/ucw/ucwctl.conf, and the same happens if
 the ucwctl.conf is specified via the command line option.  All command
 line options override the values present in any ucwctl.conf files.
 The order is the following:
 
   1) /etc/ucw/ucwctl.conf (if it exists)
   2) ~/.ucw/ucwctl.conf (if it exists)
   3) -u|--ucwctl-file (if specified, exit if it cannot be read)
   4) command line options
 
 A deeper discussion is available at:
 
   http://common-lisp.net/pipermail/bese-devel/2006-April/001932.html
   http://common-lisp.net/pipermail/bese-devel/2006-April/001961.html
] 
[In the phone and email validators instead of defining a new slot we just use the :default-initargs class option
Marco Baringer <mb@bese.it>**20060428103114] 
[Adding documentation to form.lisp
Nathan Bird <nathan@acceleration.net>**20060428023256] 
[Rearranging file contents to reduce style-warnings
Nathan Bird <nathan@acceleration.net>**20060428022511] 
[Implementing value-validators
Nathan Bird <nathan@acceleration.net>**20060428020403
 Value-validators are a category of validators that are only applied if there 
 is actually a value. This was done to provide a more systematic scheme since
 there were several different ways it was being handled previously.
 Javascript validation in this patch is untested.
] 
[Expanded the forms example to include a number-field and number-range-validated field.
Nathan Bird <nathan@acceleration.net>**20060428014551] 
[added a standard regular exprexpression validator then made e-mail-validator use it.  E-mail-validator IS NO LONGER INVALID IF EMPTY. Adde d an international phonenumber validator
russ@acceleration.net**20060425154947] 
[added regex exports
russ@acceleration.net**20060424225714] 
[Comment fixup
Nathan Bird <nathan@acceleration.net>**20060427173259] 
[Added missing id param that got lost in my <ucw:form changes
attila.lendvai@gmail.com**20060424150549] 
[TAG 2006-04-25
Marco Baringer <mb@bese.it>**20060425145623] 
Patch bundle hash:
a700870a8ddc0325d4661be5c66161daafdbabd3
