|
Description
Function BeforeShow<PageName> is executed
right before a page is displayed in the browser. Use this event to
modify the value of any template variable or to define a new
one.
Syntax
|
BeforeShow<PageName>($xt,$templatefile,$values,$pageObject)
|
Arguments
$xt - template engine object. Use
$xt->assign($name,
$val) to assign a value $val to the variable $name.
$templatefile - name of the template
file being displayed.
$values - array of displayed record
contents. You can read and write to the array. To access specific
field value use $values["FieldName"].
Field names are
case-sensitive. If the field name is PlayerId, you should use $values["PlayerId"]. Note that
$values["playerid"] or
$values["PlayerID"] will
not work.
If the field was assigned an
alias in the SQL query, then the $values array will get the alias
instead of field name from the database. E.g. if you have SQL query
select salesrep_id AS
Inv_Salesrep ..., you should use $values["Inv_Salesrep"].
$pageObject - an object representing
the current page. For more information, see Page class.
Applies to pages
View, Edit
Recommended predefined actions
and sample events
Before
display event for all pages except View/Edit
Send
a simple email
Insert a record into
another table
Check to see if a specific
record exists
Display a message on the
Web page
Redirect to another page
Hide controls on Add/Edit
pages, based on logged user name
|