Jala 1.3

## Class jala.ListRenderer

    Object
       |
       +--jala.ListRenderer

class jala.ListRenderer

Defined in ListRenderer.js

Nested Class Summary
`<static class>` | `jala.ListRenderer.ArrayList`

Field Summary
`<static> <final> Object` | `defaultRenderer` Default Renderer object containing functions used for rendering different list items (eg.

Constructor Summary
`jala.ListRenderer (<HopObject|ArrayList|Array> coll, <Object> renderer)`

Method Summary
`Number` | `currentEnd_macro()` Returns the end item number in the current page
`Number` | `currentPage_macro()` Returns the current page number
`Number` | `currentStart_macro()` Returns the start item number in the current page
`String` | `getBaseHref()` Returns the base href of this ListRenderer instance
`HopObject|Array` | `getCollection()` Returns the collection this ListRenderer instance operates on
`Number` | `getCurrentPage()` Returns the current page index.
`Number` | `getEndIndex()` Returns the zero-based index position of the last item of the current page in the collection this ListRenderer operates on.
`Number` | `getItemSkin()` Returns the name of the skin rendered for a single list item
`String` | `getList(<Object> param)` Returns the rendered list of collection items as string
`Number` | `getMaxPages()` Returns the maximum number of pages handled by this ListRenderer instance
`String` | `getNextLink(<Object> param)` Returns a rendered link to the previous page as string.
`String` | `getPageHref(<Number> page)` Returns the href of a page.
`String` | `getPageNavigation(<Object> param)` Returns the rendered page navigation bar as string
`Number` | `getPageSize()` Returns the number of items displayed on one page
`String` | `getPrevLink(<Object> param)` Returns a rendered link to the previous page as string.
`Object` | `getRenderer()` Returns the renderer used by this ListRenderer instance
`Number` | `getStartIndex()` Returns the zero-based index position of the first item of the current page in the collection this ListRenderer operates on.
`Number` | `getTotalPages()` Returns the total number of pages handled by this ListRenderer instance (which is the collection size divided by the page size).
`String` | `getUrlParameterName()` Returns the name of the URL parameter name containing the index of the page to display
`String` | `getUrlParameters()` Returns any additional URL parameters included in every navigation link rendered by this ListRenderer instance.
`Number` | `limit_macro(<Object> param)` Either renders the maximum number of items per page, or sets the limit to a given number.
`String` | `nextLink_macro(<Object> param)` Returns a rendered link to the next page.
`String` | `pageNavigation_macro(<Object> param)` Returns the rendered page navigation bar.
`String` | `prevLink_macro(<Object> param)` Returns a rendered link to the previous page.
`void` | `render_macro(<Object> param)` Renders the current page of this list.
`void` | `renderList(<Object> param)` Renders the list of items for one page directly to response.
`String` | `renderListAsString(<Object> param)` Returns the rendered list of collection items as string
`void` | `renderNextLink(<Object> param)` Renders a link to the next page directly to response.
`String` | `renderNextLinkAsString(param)` Returns a rendered link to the previous page as string
`Object` | `renderPageNavigation(<Object> param)` Renders the page navigation bar directly to response.
`String` | `renderPageNavigationAsString(param)` Returns the rendered page navigation bar as string
`void` | `renderPrevLink(<Object> param)` Renders a link to the previous page directly to response.
`String` | `renderPrevLinkAsString(<Object> param)` Returns a rendered link to the previous page as string
`void` | `setBaseHref(<String> href)` Sets the base href of this ListRenderer instance.
`void` | `setCollection(<HopObject|ArrayList|Array> coll)` Sets the collection of this ListRenderer
`void` | `setItemSkin(<String> name)` Sets the name of the skin to render for every list item
`void` | `setMaxPages(<Number> pages)` Sets the maximum number of pages to display
`void` | `setPageSize(<Number> size)` Sets the number of items to display on a single page
`void` | `setRenderer(<Object> r)` Sets the renderer to be used by this ListRenderer instance
`void` | `setUrlParameterName(<String> name)` Sets the name of the URL parameter name containing the index of the page to display
`void` | `setUrlParameters(<String> params)` Sets additional parameters to include in every navigation link
`Number` | `size_macro()` Returns the total number of items
`Number` | `totalPages_macro()` Returns the total number of pages

Field Detail

### defaultRenderer

    <static> <final> Object defaultRenderer

Default Renderer object containing functions used for rendering different list items (eg. page navigation, prev/next links and list items).

Constructor Detail

### jala.ListRenderer

    jala.ListRenderer(<HopObject|ArrayList|Array> coll, <Object> renderer)

Parameters:

`coll` - The collection this ListRenderer operates on, or - for backwards compatibility only - a parameter object containing the collection and any other optional configuration parameters.

`renderer` - An optional renderer to use. If this is set, any rendering method defined in this renderer overrides the default renderer.

Method Detail

### currentEnd_macro

    Number currentEnd_macro()

Returns the end item number in the current page

Returns:

The end item number in the current page

### currentPage_macro

    Number currentPage_macro()

Returns the current page number

Returns:

The current page number

### currentStart_macro

    Number currentStart_macro()

Returns the start item number in the current page

Returns:

The start item number in the current page

### getBaseHref

    String getBaseHref()

Returns the base href of this ListRenderer instance

Returns:

The base href of this ListRenderer instance

### getCollection

    HopObject|Array getCollection()

Returns the collection this ListRenderer instance operates on

Returns:

The collection of this ListRenderer

### getCurrentPage

    Number getCurrentPage()

Returns the current page index. This is either the page url parameter or the page number 1.

Returns:

The current page number (starts with 1).

See:

- setUrlParameterName()

### getEndIndex

    Number getEndIndex()

Returns the zero-based index position of the last item of the current page in the collection this ListRenderer operates on.

Returns:

The index position of the last item in the list

### getItemSkin

    Number getItemSkin()

Returns the name of the skin rendered for a single list item

Returns:

The name of the list item skin

### getList

    String getList(<Object> param)

Returns the rendered list of collection items as string

Parameters:

`param` - Object containing extra parameters (e.g. from a macro call).

Returns:

The rendered list

See:

- renderList()

### getMaxPages

    Number getMaxPages()

Returns the maximum number of pages handled by this ListRenderer instance

Returns:

The maximum number of pages

### getNextLink

    String getNextLink(<Object> param)

Returns a rendered link to the previous page as string. For performance reasons this method caches the rendered link in the local cache of this ListRenderer instance.

Parameters:

`param` - Object containing extra parameters (e.g. from a macro call).

Returns:

A rendered link to the previous page

See:

- renderNextLink()

### getPageHref

    String getPageHref(<Number> page)

Returns the href of a page. If no argument is given, the href of the current page is returned. Any URL parameters set with setUrlParameters() are added to the href.

Parameters:

`page` - The optional page number to include in the href.

Returns:

The href of the page

See:

- setUrlParameters()
- setUrlParameterName()

### getPageNavigation

    String getPageNavigation(<Object> param)

Returns the rendered page navigation bar as string

Parameters:

`param` - Object containing extra parameters (e.g. from a macro call).

Returns:

The rendered page navigation

See:

- renderPageNavigation()

### getPageSize

    Number getPageSize()

Returns the number of items displayed on one page

Returns:

The number of items displayed on a single page

### getPrevLink

    String getPrevLink(<Object> param)

Returns a rendered link to the previous page as string. For performance reasons this method caches the rendered link in the local cache of this ListRenderer instance.

Parameters:

`param` - Object containing extra parameters (e.g. from a macro call).

Returns:

A rendered link to the previous page

See:

- renderPrevLink()

### getRenderer

    Object getRenderer()

Returns the renderer used by this ListRenderer instance

### getStartIndex

    Number getStartIndex()

Returns the zero-based index position of the first item of the current page in the collection this ListRenderer operates on.

Returns:

The index position of the first item in the list

### getTotalPages

    Number getTotalPages()

Returns the total number of pages handled by this ListRenderer instance (which is the collection size divided by the page size).

Returns:

The total number of pages

### getUrlParameterName

    String getUrlParameterName()

Returns the name of the URL parameter name containing the index of the page to display

Returns:

The name of the page URL parameter name

### getUrlParameters

    String getUrlParameters()

Returns any additional URL parameters included in every navigation link rendered by this ListRenderer instance.

Returns:

A string containing additional URL parameters

### limit_macro

    Number limit_macro(<Object> param)

Either renders the maximum number of items per page, or sets the limit to a given number.

Parameters:

`param` - Extra macro parameters:

- to - The maximum number of items per page to be set.

If no limit is set, this macro returns the current number of items per page.

Returns:

The current maximum number of items per page

### nextLink_macro

    String nextLink_macro(<Object> param)

Returns a rendered link to the next page.

Parameters:

`param` - Extra macro parameters:

- type - The type of renderer to be applied.

Returns:

A rendered link to the next page

See:

- renderNextLink()

### pageNavigation_macro

    String pageNavigation_macro(<Object> param)

Returns the rendered page navigation bar.

Parameters:

`param` - Extra macro parameters:

- type - The type of renderer to be applied.

Returns:

The rendered page navigation bar

See:

- getPageNavigation()

### prevLink_macro

    String prevLink_macro(<Object> param)

Returns a rendered link to the previous page.

Parameters:

`param` - Extra macro parameters:

- type - The type of renderer to be applied.

Returns:

A rendered link to the previous page

See:

- renderPrevLink()

### render_macro

    void render_macro(<Object> param)

Renders the current page of this list.

Parameters:

`param` - Extra macro parameters:

- skin - The name of the list skin to render for each item in the list.
- type - The type of renderer to be applied.

See:

- renderList()

### renderList

    void renderList(<Object> param)

Renders the list of items for one page directly to response.

Parameters:

`param` - Object containing extra parameters (e.g. from a macro call).

See:

- getList()

### renderListAsString

    String renderListAsString(<Object> param)

Returns the rendered list of collection items as string

Parameters:

`param` - Object containing extra parameters (e.g. from a macro call).

Returns:

The rendered list

Deprecated Use getList() instead
See:

- renderList()

### renderNextLink

    void renderNextLink(<Object> param)

Renders a link to the next page directly to response.

Parameters:

`param` - Object containing extra parameters (e.g. from a macro call).

See:

- getNextLink()

### renderNextLinkAsString

    String renderNextLinkAsString(param)

Returns a rendered link to the previous page as string

Returns:

A rendered link to the next page

Deprecated Use getNextLink() instead

### renderPageNavigation

    Object renderPageNavigation(<Object> param)

Renders the page navigation bar directly to response. For performance reasons this method caches the rendered page navigation in the local cache of this ListRenderer instance.

Parameters:

`param` - Object containing extra parameters (e.g. from a macro call).

See:

- getPageNavigation()

### renderPageNavigationAsString

    String renderPageNavigationAsString(param)

Returns the rendered page navigation bar as string

Returns:

The rendered page navigation bar

Deprecated Use getPageNavigation() instead

### renderPrevLink

    void renderPrevLink(<Object> param)

Renders a link to the previous page directly to response.

Parameters:

`param` - Object containing extra parameters (e.g. from a macro call).

See:

- getPrevLink()

### renderPrevLinkAsString

    String renderPrevLinkAsString(<Object> param)

Returns a rendered link to the previous page as string

Parameters:

`param` - Object containing extra parameters (e.g. from a macro call).

Returns:

A rendered link to the previous page

Deprecated Use getPrevLink() instead

### setBaseHref

    void setBaseHref(<String> href)

Sets the base href of this ListRenderer instance. All links rendered will start with the href passed as argument

Parameters:

`href` - The base href to use for rendering links

### setCollection

    void setCollection(<HopObject|ArrayList|Array> coll)

Sets the collection of this ListRenderer

Parameters:

`coll` - The collection this ListRenderer instance should operate on

### setItemSkin

    void setItemSkin(<String> name)

Sets the name of the skin to render for every list item

Parameters:

`name` - The name of the skin to render for every list item

### setMaxPages

    void setMaxPages(<Number> pages)

Sets the maximum number of pages to display

Parameters:

`pages` - The maximum number of pages to display

### setPageSize

    void setPageSize(<Number> size)

Sets the number of items to display on a single page

Parameters:

`size` - The number of items to display on one page

### setRenderer

    void setRenderer(<Object> r)

Sets the renderer to be used by this ListRenderer instance

Parameters:

`r` - The renderer to use

### setUrlParameterName

    void setUrlParameterName(<String> name)

Sets the name of the URL parameter name containing the index of the page to display

Parameters:

`name` - The name of the page URL parameter

### setUrlParameters

    void setUrlParameters(<String> params)

Sets additional parameters to include in every navigation link

Parameters:

`params` - A string to append to every navigation URL

### size_macro

    Number size_macro()

Returns the total number of items

Returns:

The total number of items in the collection this ListRenderer instance is working on

### totalPages_macro

    Number totalPages_macro()

Returns the total number of pages

Returns:

The total number of pages available

Jala 1.3

Documentation generated by JSDoc on Tue Jan 8 15:45:31 2008