template::paginator::get_context (public)

 template::paginator::get_context name datasource pages

Defined in packages/acs-templating/tcl/paginator-procs.tcl

Gets the context cues for a set of pages in the form of a multirow data source with 3 columns: rownum (starting with 1); page (number of the page); and context (a short string such as the first few letters of a name or title). The context cues may be used in the paging interface along with or instead of page numbers. This command is only valid if the contextual option is specified when creating the paginator.

Parameters:
name - The reference to the paginator object.
datasource - The name of the multirow datasource to create
pages - A Tcl list of page numbers.

Partial Call Graph (max 5 caller/called nodes):
%3 template::paginator::get_reference template::paginator::get_reference (private) template::paginator::get_context template::paginator::get_context template::paginator::get_context->template::paginator::get_reference

Testcases:
No testcase defined.
Source code:
    get_reference

    if { ! [info exists properties(context_ids)] } {
        error "Invalid command (contextual option not specified)"
    }

    set context_ids $properties(context_ids)

    upvar 2 $datasource:rowcount rowcount
    set rowcount 0

    upvar 2 $datasource:columns columns
    set columns { page context }

    foreach page $pages {

        incr rowcount
        upvar 2 $datasource:$rowcount row

        set row(rownum) $rowcount
        set row(page) $page
        set row(context) [lindex $context_ids $page-1]
    }
XQL Not present:
PostgreSQL, Oracle
Generic XQL file:
packages/acs-templating/tcl/paginator-procs.xql

[ hide source ] | [ make this the default ]
Show another procedure: