NYCPHP Meetup

NYPHP.org

[nycphp-talk] the stale V in MVC web apps

David Mintz vtbludgeon at gmail.com
Wed Mar 4 13:10:35 EST 2009


On Wed, Mar 4, 2009 at 12:45 PM, Rolan Yang <rolan at omnistep.com> wrote:

> John Campbell wrote:
>
>> On Wed, Mar 4, 2009 at 12:10 PM, David Mintz <vtbludgeon at gmail.com>
>> wrote:
>>  The problem is with intervals, is that if someone's connection flakes
>> out for a minute or two, you end up doing tons of ajax calls that all
>> overlap causing wacky behavior.  The point of tail recursion is to
>> wait for the ajax call to complete, before starting the timer to do a
>> new request.
>>
>
> I've written a few ajax page periodic updaters. If the connection flakes
> and the ajax request fails, I usually pop up an alert error message so the
> user is aware that things are currently broken.  Too keep things simple, I
> send a query to the server, get back a timestamp. If that timestamp is newer
> than the current one in memory, then it refreshes the entire page. The
> downside to this is that if someone is actively editing fields, they will
> lose their data. To circumvent this problem, I have a "do not refresh" flag
>  which is set when a user clicks onto any input box. The flag is unset with
> events like onBlur or after a timeout period of keyboard/mouse inactivity so
> the page can refresh (if necessary) when idle.
>
>

I can relate. I have my thing to stop the timer when I detect that they are
in the middle of doing something -- they clicked a row to open a context
menu/tooltip, for example. It's hard work writing polite and thoughtful UIs
isn't it.

-- 
David Mintz
http://davidmintz.org/

The subtle source is clear and bright
The tributary streams flow through the darkness
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20090304/578dc417/attachment.html>


More information about the talk mailing list