Forum OpenACS Development: Dynamic variable generataion in adp page

Hi, I have a problem
I trying to use more a template for each element of one list, to disply diferent tables.  My problem is than I generate the name of the variables to set in the tcl page, but when I use the name of the variable in the adp, I must do it dynamicly as well, so I get the name of the variable, but I cant make the interpreter to know that the content of the variable who has the name is another variable.

If Im not clear enough, Ill try to explain it whith code:

.tcl
  db_multirow name get_name { *SQL* }

.adp

  <multiple name=name>
    @@name.html@@
  </multiple>

I use @@name.html@@ to especify that the content fo name.html is the name of another variable

  What I would like to know is if this can be done ?

Ill apreciate any help

Collapse
Posted by Jade Rubick on
Anny, this is a question that comes up frequently enough that I've actually linked this thread in to the FAQ.

I think the short answer is that as far as I know, there is not a way to do this. I've come across a number of times when I've wanted to do this, and I've ended up rewriting the code a little. Usually, I've found other ways of doing the same thing.

One thing I've done, for example, is to manually create my own multirow.

Anyone else know a way to do this? Dave?

In a .tcl page (if I understand correctly this), you can do something like:

set varname "actual value"
set myothervar varname

and this will return you the value of varname:
[set $myothervar]

So, you might try in the .adp:

<%=[set $name(html)]%>

or something like that...

though, I dont know if will work with <include> ....