Forum OpenACS Q&A: Advanced List-Builder examples? Group separators, data highlighting?

Can anyone here point me to good examples of advanced uses of List-Builder? I'd love to look at stuff others have done, to help me figure out how to use this tool better. Here are a few I've found so far:

There are things I'd like to do with List-Builder that I'm stuck on and can't figure out how. For example:

  • When displaying a table with many rows, I'd like to draw a horizontal separator line of some sort, when the value in a certain column changes. I have no idea how to do this. (It might also be helpful to repeat the column headers at this point.)
  • I'd like to highlight or change the color of certain table cells based on the data. E.g., when a number is very high, highlight it red. Am I supposed to use display_template for this?

Hi Andrew

  1. You should be able to get close to what you need using the groupby feature. This article I wrote in 2007 about Sub-totalling with List Builder should help - I can't find the original article, but it's archived here https://web.archive.org/web/20130903182023/http://openacs.org/blog/

  2. Yes, this is exactly the kind of thing you can do with displaytemplate. Note also that template::list::element::create supports class and subclass params, see https://openacs.org/api-doc/proc-view?proc=template::list::element::create&source_p=1

Here's an example:

lappend elements_list     scheme {
      label "[_ aims.PanelScheme]"
      display_template {
        <ul class="panel_calls">
          <li>@panels_list.scheme;noquote@
          </li>
        </ul>
      }
    }

Happy to go into further details if you need,

Brian