GalleryView Options

From Lianjapedia
Jump to: navigation, search

See Also

GalleryView Section Attributes

Overview

GalleryView Section in Lianja Web Client



GalleryView Sections are used to display a gallery of Tiles.



GalleryView Section in Lianja Web Client: expanded



Clicking a Tile displays the Content.

Click the x in the top right of the Content to return to the Tiles.


Lianja GalleryView Demo

example_galleryview App



The 'Lianja GalleryView Demo' (example_galleryview) is included in the Lianja App Builder distribution to demonstrate the use of a GalleryView Section.


example_galleryview App


GalleryView Section options

GalleryView Section options



GalleryView Sections are based on the 'galleryview.rsp' Lianja Server Page script located in the Library.

The 'Lianja GalleryView Demo' App uses default values included in galleryview.rsp, so the Attributes are not populated. Their purpose and examples are shown below.


GalleryView Section options: Tile



This screenshot shows how you would specify the same Tile using the GalleryView options Attributes.


GalleryView Section options: Content



This screenshot shows how you would specify the same Content using the GalleryView options Attributes.


The Details section at the top of the attributes dialog holds the specification of the database and table. These default to southwind and employees in the galleryview.rsp script.

The following GalleryView Section section-specific options are available:

Tile caption

The Tile caption Attribute specifies the name of the column in the table (or expression) containing the caption for each Tile.

The 'Lianja GalleryView Demo' App uses the default value. This is equivalent to:

concat(alltrim(firstname),' ',alltrim(lastname),'<br>',alltrim(address),'<br>',alltrim(city),
'<br>',alltrim(region),'<br>',alltrim(country))

Note the use of the concat() function and the HTML line break tag.

Tile category

The Tile category Attribute specifies the name of the column in the table (or expression) containing the category caption for each Tile.

The 'Lianja GalleryView Demo' App uses the default value, the title column:

title

Content title

The Content title Attribute specifies an expression to be used as the title of the Content.

The 'Lianja GalleryView Demo' App uses the default value. This is equivalent to:

concat(alltrim(firstname),' ',alltrim(lastname))

Content details

The Content details Attribute specifies the name of the column in the table containing the Content (typically a varchar/memo).

The 'Lianja GalleryView Demo' App uses the default value, the notes column:

notes

Custom library

The optional Custom library Attribute specifies the Custom library containing the Tile producer and Content producer delegates. These allow you to define your own Tile and Content layouts if you do not want to use the default ones.

The Custom library should be the name of a Lianja script file (.prg). Clicking on the [...] button will automatically generate the name of the script file and take you to the Script Editor in the Apps Workspace to edit the file. It will be loaded as a procedure library by galleryview.rsp.

libgv_page1_section1.prg

e.g. GalleryView Section using the southwind!customers table

// libgv_page1_section1.prg
// The Tile and Content delegates just output HTML
// Use the '?' display command followed by a character string
// or enclose text in a 'text raw' 'endtext' block
// Use '&' for macro substitution

proc myTileDelegate()
	private m_title = customerid
	private m_category = contactname
	text raw
	<h2 class="title title--preview">&m_title</h2>
	<div class="loader"></div>
	<span class="category">&m_category</span>
	endtext
endproc

proc myContentDelegate()
	private m_contenttitle = contactname
	private m_content = notes
	? '<h2 class="title title--full">&m_contenttitle</h2>'
	? '<p>'
	? m_content
	? '</p>'
endproc

Tile producer

The optional Tile producer Attribute specifies the Delegate to call to render a custom Tile.

myTileDelegate

See above for the script used in the screenshot.

Tile producer


Content producer

The optional Content producer Attribute specifies the Delegate to call to render the Content.

myContentDelegate

See above for the script used in the screenshot.

Content producer


Filter

The optional Filter Attribute specifies the filter expression that restricts which records will be included.

e.g. GalleryView Section using the southwind!customers table

customerid < "N"

Order by

The optional Order by Attribute specifies the orderby expression for the data in the GalleryView.

e.g. GalleryView Section using the southwind!customers table

country

Notes on Client Support

Attribute Notes
Tile caption -
Tile category -
Content title -
Content details -
Custom library -
Tile producer -
Content producer -
Filter -
Order by -