Forum OpenACS Development: Re: listbuilder - pre-checking some checkboxes?

Collapse
Posted by Vinod Kurup on
I know this post is 2 years old, but I just had the same question and found 1 way to do it, so thought I'd post it here for the next wanderer...

First, set -has_checkboxes which tells the listbuilder that you will create your own checkboxes.

Then, in the -elements section, create an element like this:

-elements {
  checkbox {
    display_template {<input type="checkbox" name="yourlistkey" value="@yourmultirow.yourlistkey@" @yourmultirow.checkbox@ />}
  }
...
}
Then, extend your multirow with the 'checkbox' variable.
db_multirow -extend {checkbox} yourmultirow .... {
  if { $my_criteria } {
    set checkbox "checked"
  } else {
    set checkbox ""
  }
}
Replace yourmultirow with the name of your multirow.
Replace yourlistkey with the listkey column of your list