Forum OpenACS Development: Variable number of elements in listbuilder

Hi,

I am trying to create a list builder that has a variable number of elements depending on how many elements are in the database.

I tried creating a variable for an element and then use the variable to create the element, but i can't place the variable in place of the element code. The error i get is:

can't read "code": no such variable

This is what I have so far:

set code "fname { label \"First Name\" }"

template::list::create \
-name matrix \
-multirow matrix \
-key empapp_id \
-no_data "No One Has Applied For This Position." \
-elements {
lname {
display_col lname
link_url_col lname_url
link_html {title "View This Resume"}
label "Last Name"
}
fname {
label "First Name"
} $code2
}

db_multirow -extend...

Any ideas?

Collapse
Posted by Dave Bauer on
Try something like this

set elements {
lname {
display_col lname
link_url_col lname_url
link_html {title "View This Resume"}
label "Last Name"
}
fname {
label "First Name"
}
}

lappend elements fname {label "First Name"}

template::list::create \
-name matrix \
-multirow matrix \
-key empapp_id \
-no_data "No One Has Applied For This Position." \
-elements $elements

Collapse
Posted by Brad Poulton on
That worked great thank you!