Thursday, 8 July 2010

Firefox Madness

Normally I rant about Internet Explorer. Don't even get me started on 6. 7 is bad enough. 8 is close to being basically usable. No I didn't just say that, did I? It's not. It's a nightmare.

But this is not about IE, it's about how everyone's darling Firefox just kept me dazzled for the best part of an hour on a trivial problem.

Using Stripes, there are some amazingly useful JSP taglibs shipping with it. One of my favourites is options-enumeration. This little beauty populates a combo box with the values from an enum. Plus, Stripes converts it back to enum when the action is called. Hibernate can persist it. How cool is that - one enum in a domain object and it works straight away.

Now one thing I was struggling with for a while was how to select the value from the pre-populated action. One option should be selected, according to whatever value the field of my domain object currently has.

Now by all means, that didn't work. Stupid dropdown kept on showing me "female" gender. I refreshed numerous times. I checked the database if the value was correct. I checked the source code of the options-enumeration tag. Don't you have that as well, when you're looking for the most complicated solution first, confident that it can't be a simple problem you're facing?

In the end, it turned out that some good soul made firefox keep form values on refresh. Guess what... CTRL-Refresh solved it. PEBKAC.

No comments:

Post a Comment