[Bese-devel] actions and broswer refresh

Drew Crampsie drewc at tech.coop
Wed Feb 22 01:17:54 UTC 2006


Attila Lendvai wrote:

>hi!
>
>recently i've discovered that if i render an action with action-href,
>press the link, and then refresh the browser, then the action is
>triggered again.
>
>is this the expected behviour? 
>
of course it is! :) imagine (<ucw:a :action (display-current-time self) 
...). click on it, now hit 'back', and then click on the link again. 
You'd expect the time to update, right? i would. or a page with a 
meta-refresh that shows the 'current' news items....

>i've quickly wrapped a triggered
>closure flag in make-new-action and it solves this but this is not The
>Right Way (tm). then i tried playing with the action hashtable with
>less success.
>  
>
try (defaction foo :isolate ....), which may or may not still work (has 
anybody tried this lately?). If that doesn't work for you, mail me and 
i'll fix up the memoizing code.

>i think that the action should be unregistered once it was triggered,
>but i may miss some details here...
>  
>
One of the great things about UCW is that it supports the back button, 
session clones, and other webby features. Unregistering an action breaks 
this, and would break user expectations very quickly. imaging a page of 
search results ... i click a link in a new window, then close that 
window .. oops .. i want to view that link again... so i click it, 
trigger the unknown action restart, which puts me right back at the 
entry point, and i can't ever see those results again.

the :isolate code ensures the the body of an action is only executed 
once, but still returns the value when the action in invoked again. I 
believe this is the 'correct' behavior. (assuming it still works). Is 
this sufficient for your needs?

drewc

>any opinions? Marco?
>
>- attila
>
>(alias 101 on irc &no 'its not lisp code :)
>_______________________________________________
>bese-devel mailing list
>bese-devel at common-lisp.net
>http://common-lisp.net/cgi-bin/mailman/listinfo/bese-devel
>  
>




More information about the bese-devel mailing list