Forum OpenACS Development: listbuilder: export url-vars for orderby/filters?

Using the listbuilder I ran into the following problems:

a) I want to let users order by various columns and already defined the necessary orderby-clauses in listbuilder, but the links automagically provided for sorting do not contain certain necessary url-vars. I don't have the slightest clue how to tell listbuilder which url-vars to export there - is this a bug or a missing feature?

b) I use checkboxes and bulkoperations, but due to the fact that I want to provided checkboxes only for certain rows, I added my very own checkbox-element and used the switch -has_checkbox, but now I don't know how to add the topmost checkbox for "select all". Is this also a missing listbuilder feature?

Collapse
Posted by Barry Books on
To add variables to the url add
        -filters {
                counter_id {} # your variables here
        }
to your list::create code
If i create the filter whit
template::list::filter::create -list_name list \ -filter_name filter_name -spec { } . Help ME!!!!!
Have you looked at http://your.server/doc/acs-templating/demo where you will find a few examples with code?

Also, you haven't actually asked a question yet so I have no idea what you want.

-Jim

Hi Alexander

first of all, you probably don't want to call template::list::filter::create directly. Instead you should have a template::list::create with a -filters e.g

set filter ""
append filter { parameter_super_scheme_id {
                  where_clause_eval {
                    set where {and 1 = 1}
                    if { $parameter_super_scheme_id != 0 } {
                      set where "and abc.super_category_id = :parameter_super_scheme_id "
                    }
                    set where
                  }
                }
}
append filter { parameter_scheme_id {
                  where_clause_eval {
                    set where {1 = 1}
                    if { $parameter_scheme_id != 0 } {
                      set where " abc.category_id = :parameter_scheme_id "
                    }
                    set where
                  }
                }

template::list::create \
  -name $list_name \
  -multirow tickets \
  -elements $elements_list \
  -orderby $orderby_list \
  -groupby $groupby_list \
  -filters $filter

You have to pass in to ad_page_contract your filter parameters (parameter_super_scheme_id and parameter_scheme_id in my case). And finally, remember to add [template::list::filter_where_clauses -name $list_name] to the end of your SQL statement that you use to build the multirow.