Inspiration, ExtJs, through Rich Waters.
I've more or less come to the conclusion that HTML in lookup-views is evil.
On one of the apps I work with, there were two access levels, reader, and editor. I used to have a column for each access, and pull HTML from the view.
col := @If( @UserRoles = "[Editor]" ; 4 ; 5 );
@Implode( @DbLookup( "" ; "" ; "(lupView)" ; key ; col ; [FailSilent] ) ; "" )
The errors wouldn't come as far as to applications in production now, as we test thouroughly before release, but it could still be a maintenance headache.
Step one to get rid of headaches:
Moving the presentation out of the viewGet rid of HTML-views, use simple lookup-views (value1|value2|value3) instead. Example of transformation to HTML.
Step two to get rid of headaches:
You're probably not going to save any time writing the transformation to HTML using templates the first time, but you'll save time in the long run. Having the template in one string instead of concatenating bits of the html-per-item on several lines also increases readability of the code.
Example of simple evolution:
>> Simple demoapp
For my access-level-problem, I either write a separate template for each access (e.g. add edit link for [Editor]),
or put @If(@UserRoles = "[Editor]" ; "" ; @Return("") ) at the top (don't do anything if not editor).