Archive | September, 2010

Getting an extra item in your list control?

07 Sep

Had a stupid bug that cost me a lot of time so I figured I’d post the solution here in case others stumble onto the same problem.

I had an app with a Horizontal List control and for some reason, Flex insisted on adding an extra item to my list whenever I added a new item to it? Strange. This only happened after I converted the project to Flex 4 and when I went back to Flex 3, it worked as it should. I debugged and confirmed that it was getting the correct dataprovider and despite there being only two items in the dataprovider, three items were rendered.

I looked and looked in all the wrong places until I noticed that I was setting “horizontalScrollPosition” to -1? Why on earth was I doing that? Turns out that if you do this, Flex 4 will create the missing item in your list rather than throwing an “out of bounds” error. Hope this helps someone else with a similar problem!

Review: ExpressionEngine 2 - A quick-start guide

06 Sep

ee2_ryan2.jpgThese days I do more and more sites and apps using ExpressionEngine (EE) as the backend. I recently did my 10th EE-driven site and I have request for a couple more in the pipe. It seems that EE is really starting to take off and also so with the publishers. I recently got a request to review an EE2 book from Pragmatic Bookshelf and thought why not?

I’ve read a couple books on EE, but this is the first I’ve seen that covers the new ExpressionEngine 2. The book is written by Ryan Irelan (of EE-insider fame) and has a foreword by Rick Ellis (the creator of EE) so it sure seems solid.

The book covers everything you need to know, from the initial setup to building a complete site. Every core feature is explained and the examples are well written and very easy to follow. When learning to use software through converting a site like I did, you tend to learn only the parts that you think is relevant. Learning from a book that covers all topics is good as you’ll know even more about those not so often used features that a very nice to have. I didn’t learn anything new in the first half of the book, but from there and out there were several useful bits that I picked up.

Especially the chapter explaining how to build relationship between entries is very well thought out and written. This is something I’ve always had a hard time with, but now I feel that I fully understand the power of it. It’s the kind of feature that I’ve had to do a lot of testing to get right, but thanks to this chapter I now feel that I’ll get this right the first time.

On thing I missed in this book was the solid discussion that you’ll find in Michael Boyink’s PDF-book  on how to plan when building a site from scratch. How does it make sense to structure the site? What requires that you make it it’s own ‘channel’ and how can you break down existing designs into smaller bits. The ‘EE2 - A quick-start guide’ is however much more complete in that it goes through and explains every core feature in a pedagogically correct way, but I would probably recommend someone planning to convert a big site to EE to read both books.

All in all - many things to like about this book. Chapter 10 that covers optimizing your EE site alone is worth the money for this book as getting the caching right can actually save you from server upgrades. It’s a well written guide for the complete beginner and covers all the topics that such a book should. It could however have been more complete and covered more ground. This is however enough to get you started and from there on, you can lean on the excellent EE documentation and forums.