logo

Document Rating Demo Updated

Following Friday's discussion on creating pauses in LotusScript I've revisited the code and done what I probably should have done in the first place. Had I known it would have become a permanent feature I think I would (no, honestly, I would) have used JavaScript to create the pause. What was I thinking!?

The end user would have no idea whether you created the pause in JavaScript or LotusScript. The effect is the same. At least with JavaScript there's no adverse effect on the server and so the other users don't need to know about it.

I've updated the demo version and you can see the new code in the script file (updated: please download the latest version of DEXT from tha sandox instead) .

You might notice another change in the form. If you click to rate an article the mouse cursor turns in to an hour glass. This was an idea Glen Rohrer suggested on Friday as an additional/alternative way to let the user know something is happening. Having never tried anything like this I thought I'd give it a go. Turns out it's fairly simple to do and effective too.

The logic now goes something like this:

  1. User presses a star
  2. JavaScript changes cursor to hour glass, like so: $("ul.star-rating li a").css({"cursor":"wait"})
  3. JavaScript waits three seconds and then calls the Ajax routine.
  4. Ajax returns data and JavaScript processes it before re-setting the user's cursor: $("ul.star-rating li a").css({"cursor":"pointer"})

My only misgiving with the approach is that, to me, seeing the hour glass means the browser is in trouble. The only time you see the "wait" cursor in a browser is when it's about to crash or become unresponsive for a while. A better cursor to use might be the progress cursor, which is what I've actually used in the demo and the updated download.

Note that I'd also tried the following:

$("*").css({"cursor":"wait"})

This means that the cursor is the hour glass wherever it is on the screen. When complete the function returned the cursor to normal like this:

$("*").css({"cursor":"auto"})

However, this only worked in IE. In Firefox links would no longer show the "hand" when you hover over them. So I scrapped that idea. Although, having thought about it, it was a bad idea anyway. Having the whole page show the wait cursor might give the idea nothing is possible, whereas we all know the user can still interact with the rest of the page. Keeping the wait cursor local to the star rating links gives the impression that this part is now busy, which is a better message to give.

So, in summary, I think we're all agreed the pause is a good idea, but not when it's on the server. Coupled with some simple CSS we can nicely convey the message to the user that their action has actually had an effect and they just have to wait to see it.

See also: More on support for different cursors in the browsers.

Comments

    • avatar
    • Jan
    • Mon 17 Dec 2007 12:36 PM

    Please don't mess with my cursor.

    I don't mind user feedback, but changing my cursor without a sound reason (aka "you can't click now") ist IMO bad. Usually I don't want to wait, but I will wait for a 'waiting'-cursor -> it "steals" a few seconds of my time.

    Do something with the rating, like wait half a sec after getting the results, fade off the old one and fade in the new one. Or fade off, do the stuff, fade in. And if you don't get a result, display an error instead of the new result.

  1. I absolutely love this! Imagine how cool it would be to implement this within Quickr libraries? It sure would make the Wiki template a bit more useful! Thanks again, Jake!

    • avatar
    • Jake Howlett
    • Mon 17 Dec 2007 01:57 PM

    I was in two minds about this Jan, but I didn't expect it to annoy anybody as much as that. I see what you mean though about it fooling the user in to *actually* waiting and, thus, wasting time.

    As with lots of things I post here it's merely an idea. Whether I'd personally ever use it for a real application or not I don't know. Probably not in the case of the cursor. It's nice that it can be done, but the fact that it never is means it's too out of the ordinary to sit well with most users.

  2. I really like this work, and I consider it 'complete'.

    Maybe I would consider to not make it possible to click 2 times a star just to limit the traffic on a server (Now I get a decent message that I already have voted and my last vote will not be counted in the voting), but that is more a consideration of development-time...

    • avatar
    • Jake Howlett
    • Tue 18 Dec 2007 03:43 AM

    Good point Patrick. I'm aware of the ability to repeat click the stars on the first visit to a page. Preventing this is trivial though. I left it in merely to demonstrate how the agent returns an "error" if you click again. No, honestly, I did. Otherwise you'd never get to see that message...

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment:


About This Page

Written by Jake Howlett on Mon 17 Dec 2007

Share This Page

# ( ) '

Comments

The most recent comments added:

Skip to the comments or add your own.

You can subscribe to an individual RSS feed of comments on this entry.

Let's Get Social


About This Website

CodeStore is all about web development. Concentrating on Lotus Domino, ASP.NET, Flex, SharePoint and all things internet.

Your host is Jake Howlett who runs his own web development company called Rockall Design and is always on the lookout for new and interesting work to do.

You can find me on Twitter and on Linked In.

Read more about this site »

More Content