Thursday, August 28, 2008

UI Annoyance: Unselectable text in a disabled form field

A usability annoyance that I've encountered on a few occasions is a disabled field on an desktop or web application form which doesn't allow text in the field to be selected, and therefore, prevents the value in the field from being copy & pasted to another location.  (This side-effect of not allowing a clipboard copy of the field's value may or may not be above and beyond the developer's intention of simply not allowing the contents of the field to be modified).

For example, the web application server WebLogic Server 9 (WLS9) includes a web-based administrative console where database connection strings and other settings for hosted applications can be defined.  In the WLS9 console, one user at a time can obtain a lock on the console, preventing other users from concurrently making conflicting changes; when the current user does not have the lock, all editable fields are disabled.  In this state, field values can't be selected and copied to the clipboard.  This effectively prevents the user from doing things like copying settings from admin console form fields to another WebLogic instance, or copying a hosted application's settings from the console to document them in the application's internal documentation. 

There's no reason that the WLS9 console needed to be coded to prevent clipboard copying of values in this way; after all, the disabled field values are still visible, and the user can always just manually read and retype them elsewhere.  It's just an annoyance for the user to have to do manual retyping of values (such as long, complex database connection strings) when they could be using a clipboard copy to get the values.

HTML form fields: Disabled vs. Readonly

In HTML, an input type="text" field can be set with the attributes disabled or readonly.  The attributes have similar behavior; both prevent the field contents from being modified.  One key difference, though, is that the readonly attribute still allows the value in the field to be selected (and copied to the clipboard); the disabled attribute may prevent the value from being selected and clipboard copied, depending on the client browser's implementation.  (For example, Firefox 3 prevents the value from being selected; Internet Explorer 6 does allow the value to be selected.)

Try dragging with the mouse inside each of these fields, to see what behavior your browser allows:

<input type="text" value="Try selecting this text" readonly> :

<input type="text" value="Try selecting this text" disabled> :


Web application developers, before using the disabled attribute on a text input field on a web form, consider whether your users may ever want to clipboard copy the value in cases when the field is disabled.  If so, consider using the readonly attribute instead.

The same principle holds true for desktop application developers as well.  Consider whether your users will ever want to clipboard copy values from your disabled form fields when defining the behavior of whether the field values can be selected or not while disabled.

Tuesday, August 19, 2008

Workaround: Windows Media Player sound cuts out when Cisco VPN client v4.x is active

I had the opportunity to work from home today.  It was nice to change up my routine and get a good bit of mostly-uninterrupted work done.  The best part was probably getting to spend a full hour at lunchtime having lunch with my wife Melissa and my kids!

I did run into two issues during the course of day, though.  One was that the Charter cable modem service decided to go out for an hour or so in the afternoon (and the VOIP phone service along with it); there wasn't much I could do about that aside from work offline and wait it out.

The other issue was a strange one; while listening to mp3s on my local C: drive in Windows Media Player 11 (WMP), the playback would work fine for a minute or two, but then the sound would cut out.  The song would still apparently be playing (as evidenced by the track position slider continuing to advance), but I'd get only silence from my speakers or earphones.  Sounds from other Windows apps would still play as normal.  If I clicked Stop and then Play in WMP, or Previous Track / Next Track, the sound would come back for another minute or two, and then cut out again.  This behavior happened regardless of whether WMP was minimized or not, or whether it was in full mode or skin mode. 

I also noticed that when the sound playback cut out, the wmplayer.exe process (the Windows Media Player process) would peg the CPU it was running on; I could see in Task Manager that one of the two CPUs (on my dual-core machine) would go to 100% utilization, with wmplayer.exe accounting for 50% of my overall CPU usage (100% of 1 of the 2 CPUs).  If I stopped the playback or brought the sound back by clicking Previous Track / Next Track, the CPU utilization would go back to normal (less than 5%).  I tried pointing SysInternals' Process Monitor at wmplayer.exe while WMP was in the "pegged" state, but it didn't turn up any errors or any behavior that I could readily identify as unusual.

Since I use Windows Media Player on my laptop docked at my desk at work every day, I figured that the problem was probably related either to working with the laptop undocked, or else had something to do with my VPN connection to my office's intranet.  I ended up just getting out my iPod and listening to my music on that instead as a workaround.

At the end of the day, though, I came back and investigated the issue.  (It just bugs me when something on my machine isn't working the way it should be!)  Various Google web searches for combinations of terms including "windows media player", "100% cpu", "sound cuts out", and "vpn" didn't turn up anything useful, but when I searched for "vpn" on the microsoft.public.windowsmedia.player newsgroup, I came across what turned out for me to be the key to the solution: a 2005 post by "bsmaloney" describing nearly-identical behavior to what I was seeing.  bsmaloney didn't post a solution, but he mentioned that he was using a version 4.x Cisco VPN client.  This is what I was using as well!  It hadn't occurred to me up to that point that the problem might be attributable to a specific vendor's VPN implementation, rather than the fact that I was connected via a VPN in general.

I went back to Google and searched on "windows media player" vpn cisco, and sure enough, the #1 result was a Cisco VPN client release notes page listing that an issue related to Windows Media Player playback had been fixed in version of the Cisco client.  The release notes also mentioned that the problem would occur when either the SRS WOW or Graphic Equalizer were enabled.

It wasn't an option for me to upgrade to version 5 of the Cisco VPN client, since the standard at my office is still the 4.x version.  However, I checked in WMP, and I did in fact have the Graphic Equalizer enabled.  I turned that off (View menu | Enhancements | Graphic Equalizer), and playback has been working fine since then!

As a side note, the Cisco release notes page refers to the bugs it describes as "caveats."  I thought that was kind of cute.  "Defects" and "issues" I've heard of before, but the using term "caveats" to describe software bugs was a new one on me!

Tuesday, August 12, 2008

Really impressive live Internet-delivered Olympics video

I just watched the most impressive (quality-wise) Internet-delivered video I've yet seen -- and live video, at that! It's the coverage of the 2008 Olympics over at To watch, follow that link and pick one of the events on the left column of the homepage with a red "live" tag next to it. (Video on the site might be available to USA-based visitors only -- I'm not sure.) The video is very high-quality for browser-delivered video -- both large size and high resolution. Much nicer than the typical YouTube fare (small size, grainy quality) that I would normally associate with watching video on the Web. There was no audio commentary for the event I was watching (Judo), but there was a text-based commentary, plus a live scoring summary. The video also included instant replay of the action, just like you'd expect in the coverage of any sporting event. Really impressive overall presentation. Kudos to the NBC team for pulling this together, and to Microsoft for providing the Silverlight technology that the video is running on. If you haven't seen it yet, I would suggest making it a point to head over to the NBC site and watching for at least a few minutes at some point before the Olympics are over!

Tuesday, August 05, 2008

Excel tip: Shift+F2 = Edit Cell Comment

A quick tip for Microsoft Excel that I've just found, and is currently making my life easier: Shift+F2 jumps to editing the cell comment (note / annotation) for the current cell.

This is a lot nicer than having to go over to the mouse and right-click on a cell, then choose "Edit Comment" (or "Insert Comment" in the case of a cell that doesn't have a comment yet) from the context menu when doing heavy editing work on an Excel sheet.

This works in Excel 2003; it might also work in other Excel versions as well.

Bonus tip: F2 alone (without holding Shift) edits the existing value in the current cell.  This is another time-saver that allows you to edit the value in a cell without having to move over to the mouse. 

The use of F2 to mean "edit the current value" is a semi-standard that works in many other Windows applications as well.  For example, F2 in Windows Explorer begins editing the name of the selected file or folder (to allow the file or folder to be renamed).