Learning
Documentation
Community
Open Exchange
Global Masters
Home / Class Reference / ENSLIB namespace / %CSP.PageLookup
Private  Storage   

%CSP.PageLookup


class %CSP.PageLookup extends
%CSP.Page

CSP page that provides a standard lookup for wizard-generated forms. It expects the following input:

CLASSNAMEName of class to perform lookup on.
OBJIDID of current instance.
SELECTA comma-delimited list of fields to display in the search result table. Each field is of the form 'property alias|desc' where alias and |desc are optional. If not specified, the WHERE list is used as the SELECT list.
WHEREA comma-delimited list of fields to search on. Each field is of the form 'property alias|desc' where alias and |desc are optional.
ORDERA comma-delimited list of fields used to sort the search results. Each field is of the form 'property |desc' where |desc is optional.
MAXROWSMaximum rows to display; if missing don't execute query.
TARGETURL of page to return to with results.
CAPTIONCaption for search window.
OPTIONSComma separated list of feature codes. These include popup, create, and clear.
OBJIDATTRThe name of the OBJID attribute for the associated form.

Note: For range operations the value in the WHERE parameter contains two values delimited by &.

Inventory


Parameters Properties Methods Queries Indices ForeignKeys Triggers
16 18


Summary


Methods
%ClassIsLatestVersion %ClassName %Close %DispatchClassMethod
%DispatchGetModified %DispatchGetProperty %DispatchMethod %DispatchSetModified
%DispatchSetMultidimProperty %DispatchSetProperty %Extends %GetParameter
%IncrementCount %IsA %New %OriginalNamespace
%PackageName %SetModified BuildSelectStatement ConvertParameter
CreateResultSet Decrypt Encrypt EscapeHTML
EscapeURL GetPropSqlName GetPropType HyperEventBody
HyperEventCall HyperEventFrame HyperEventHead Include
InsertHiddenField InsertHiddenFields IsPrivate Link
OnHTTPHeader OnPage OnPageError OnPostHTTP
OnPostHyperEvent OnPreHTTP OnPreHyperEvent Page
PageName QuoteJS RewriteURL ShowError
StartTimer StopTimer ThrowError UnescapeHTML
UnescapeURL


Parameters


• parameter CANCELBTN = "Cancel";
Caption for Cancel Button.
• parameter CHARSET = "utf-8";
Make default charset for the page UTF-8.
• parameter CLEARBTN = "Clear";
Caption for Clear Button.
• parameter DEFAULTCAPTION = "Caché Search";
Caption displayed if none specified (for normal mode).
• parameter ENCODED = 1;
Override ENCODED from %CSP.Page
• parameter FINDMSG1 = "Find all instances of ";
First half of "Find all" message.
• parameter FINDMSG2 = " that meet the following conditions:";
Second half of "Find all" message.
• parameter FOUNDMSG1;
First half of "Items Found" message.
• parameter FOUNDMSG2 = " matching item(s) found.";
Second half of "Items Found" message.
• parameter NOCRITERIA = "At least one search condition must be specified. Search not executed.";
Error message to display when no criteria are specified for a search and the search button is pressed.
• parameter NOMATCH = "No matching items found.";
No matching items message.
• parameter PREDICATELIST = "equals,not equal to,starts with,between,less than,greater than,contains,select";
List of values displayed in search predicate combo box.
• parameter PRIVATE = 1;
Override PRIVATE from %CSP.Page
• parameter SEARCHBTN = "Search";
Caption for Search Button.
• parameter SHOWNMSG1 = "The first ";
First half of "Items Shown" message.
• parameter SHOWNMSG2 = " are displayed below:";
Second half of "Items Shown" message.

Methods


• classmethod BuildSelectStatement(class As %String, proplist As %List, ByRef statement As %String, getcount As %Boolean = 0, idname As %String = "", select As %String = "SELECT", Output idfield As %Integer) as %Status
Constructs a SELECT statement for the property list proplist.
• classmethod CreateResultSet(class As %String, restrict As %List, return As %List, orderby As %List, getcount As %Boolean, ByRef resultset As %ResultSet, ByRef rcount As %Integer, idname As %String = "", ByRef idfield As %Integer) as %Status
Constructs a query using the input values, opens a %ResultSet object using this query and returns it via resultset.

class
The name of the class to perform the lookup on.
restrict
A list of restrictions as $lb(property,value).
return
A $list of properties to return in the resultset.
orderby
A list of $lb(property,ASC|DESC) that specify the order of the result set.
getcount
If true, the query should fetch the number of rows in the result.
resultset
Returns a %ResultSet object by reference.
rcount
Returns number of selected rows by reference. -1 indicates that the row count is in column 1 of the result set.

Returns a %Status indicating success or failure.

• final classmethod GetPropSqlName(classname As %String, prop As %String, ByRef column As %String) as %Status
Returns the SQL name of property prop for class classname in field.
• final classmethod GetPropType(classname As %String, prop As %String) as %List
Returns the type (SQL Category) of property prop for class classname.
• final classmethod OnPage() as %Status
Event handler for PAGE event: this is invoked in order to display a csp page.
• classmethod PageName() as %String
URL Name of this class
• private classmethod ShowCaption()
Display the caption for a lookup page.
• private classmethod ShowCriteria(classname As %String, where As %List)
Display the criteria form for a lookup page.

where is $list of criteria, each element is $LB(name,pred,val...)

• private classmethod ShowForm(classname As %String, where As %List, select As %List, currval As %String)
Display the criteria form for a lookup page.

where is $list of criteria, each element is $LB(name,pred,val,alias)

select is $list of fields that can be sorted on

currval is current sort field

• private classmethod ShowNoCriteria()
Display an error message when search criteria must be specified before a search is requested (OPTIONS=CriteriaRequired) and no criteria are specified.
• private classmethod ShowOneChoice(val As %String, id As %String, initval As %String)
Display a choice option.
• private classmethod ShowPredicates(name As %String, pred As %String, showOptions As %Boolean)
Display a list of predicates in a SELECT box.
• private classmethod ShowResults(classname As %String, select As %List, where As %List, sort As %List, maxrows As %Integer, showcount As %Boolean = 1, idname As %String = "") as %Status
Display the results of the lookup in an HTML table.
• private classmethod ShowScripts()
Display the client scripts for the lookup page.

This has to be called within the HEAD section of the document.

• private classmethod ShowSelectChoices(classname As %String, name As %String, initval As %String, pred As %String)
Display the choices for a select predicate.
• private classmethod ShowSort(select As %List, currval As %String)
Display the sort options for a lookup page.

select is a list of selected fields.

• private classmethod ShowStyleSheet()
Display the HTML Style Sheet for the lookup page.

This has to be called within the HEAD section of the document.

• private classmethod ShowTitle()
Display the title for a lookup page.