[Bese-devel] Re: forcing a client refresh

hbabcockos1 at mac.com hbabcockos1 at mac.com
Thu May 25 05:15:10 UTC 2006


> (defmacro timed-self-refresh (delay-in-ms)
>   `(<:script :type "text/javascript"
>     (<:as-is
>      (js:js
>       (defun init-timed-refresh-call ()
> 	(set-timeout "doTimedRefreshCall()" ,delay-in-ms))
>       (defun do-timed-refresh-call ()
> 	(window.location.reload))
>       (setf window.onload init-timed-refresh-call)))))

Another more useful refresh option, as I slowly learn more about ucw.  
It works with functions but not actions, it isn't clear to me why  
this is so.

(defun timed-function-call (delay-in-ms function argument)
   (let ((href (concatenate 'string "location.href='"
			   (action-href (lambda () (funcall function argument)))
			   "'")))
     (<ucw:script `(setf window.onload
		   (set-timeout ,href ,delay-in-ms)))))

-Hazen




More information about the bese-devel mailing list