Forum OpenACS Development: Referring to the columns of a dynamically generated multirow in and ADP

I have a multirow datasource with some of the columns extended onto it from data in a tcl list. That is, the names of the additional columns are in a list. So i do something like this:

set column_names [db_list get_col_names {}]
foreach col $column_names {
    template::multirow extend my_multirow $col
}

Now, I need to ouput the columns in my ADP template. I tried something like this:

<multiple name="my_multirow">
<list name="column_names">
@my_multirow.@column_names:item@@
</list>
</multiple>

But that does not work. I end up with @my_multirow.list_element@ with list_element being the various values in the list.

I tried several different ways to format this, using list_of_lists etc, and could not find an easy way to accomplih it. What I ended up doing was rendering the HTML for a table row with the multirow contents in the TCL. Is this possible, or even a good idea?

Wow, noone is interested in this? Am I the only one who is building a multirow with dynamically generated columns? Seems like it would be a handy feature.
I am interested. In fact, a while ago I did something where I did what you're looking for with some templating magic, but it's been like 2 years and I can't remember.

I'm going to dig up the code.

-Roberto

It depends on what you want to want to display, but couldn't you achieve what you want by adding one row to the multirow per column/value pair and group by the original rownumber?

E.g.

set original_rownum 1
multirow create my_multirow original_rownum column value
db_foreach ... {
  multirow append my_multirow $original_rownum col1 $col1
  multirow append my_multirow $original_rownum col2 $col2
  incr original_rownum
}

<multiple ...>
<tr>
<group column=original_rownum>
<td>@my_multirow.value@</td>
</group>
</tr>
</multiple>