You might check out my recent post: Dataview Plugin Snippet Showcase (Dynamic Magic Book Catalog)
I spent a couple of (painful) days dealing with this issue, and I captured the solution that finally worked for me.
The post also summarizes some of the subtleties I found while working on the project. I hope it helps.