Give me a hand! (Cursor, that is)

I’ve created a few custom Community Server link controls in my day deriving from WrappedContentBase that display a modal window when clicked.  They’re smart and efficient, but I didn’t like the fact that when doing a mouseover the cursor did not change to…the hand.

Certainly I could make this happen with CSS, I thought, but found it took a little longer than the 3 minutes I anticipated it to take.  Thus, the incident burst into blog-worthiness and so here we are.

The secret CSS sauce to cause an area to trigger “the hand” on mouseover follows.  It works in IE6/IE7 and Firefox.

.PopOver
{
    cursor: pointer;
    cursor: hand;
}

I guess I should say a word about the Custom Link Objects that display Modal Windows in Community Server.  The HTML when dropped onto the page would look like the following.

<DBVT:POLineDetailsImageLink ID=”POLineDetailsImageLink2″ runat=”server” CssClass=”PopOver” Tag=”Span” />

And that’s it.  As I said, pretty darn efficient.  The CodeBehind content binding code creating the modal window link looks like this, with the essential link construction code in bold.

CSContext csContext = CSControlUtility.Instance().GetCurrentCSContext(this.Page);
POLine poline = this.DataSource as POLine;

if (poline.POLineDetail != null)
{
    HyperLink imageLink = new HyperLink();
    imageLink.Attributes[“onclick”] = ModalHelper.BuildHandler(this.Page,
        JobUrls.Instance().POLineDetails(poline.PoItemID), 700, 500, “null”, true);

    imageLink.ImageUrl = Globals.ApplicationPath + “/images/details.gif”;
    control.Controls.Add(imageLink);
}
    else
    this.AutomatedVisible = false;
}

The information about creating Modal Window link objects is pretty cool, but it doesn’t hold a candle to releasing “the hand.”  Just my opinion, of course…

Article written by

A long time developer, I was an early adopter of Linux in the mid-90's for a few years until I entered corporate environments and worked with Microsoft technologies like ASP, then .NET. In 2008 I released Sueetie, an Online Community Platform built in .NET. In late 2012 I returned to my Linux roots and locked in on Java development. Much of my work is available on GitHub.