This element declares a data member for the page subclass corresponding to the containing page. The value of this data member can be preserved between consecutive postbacks. The attribute "persist" determine how to save the variable's value: to session table for inter-page usage, keep in page state only or do not keep it at all. Note that inter-page variable storage is available only when a vspx:login control is included on the page and authentication is performed; also the name of page variables in corresponding pages needs to be same. There is no special class for this control because only a data member will be added. Also the page defines two special variables 'sid' and 'realm' for login control. So when an existing login control is is in authenticated state, these will contain values for session id and application realm. Also every non-repeating control of the page will be represented as a page variable and thus be acessible as 'self.<name_of_control>' anywhere in the VSPX page after page initialization.
The name of page class member.
The SQL data type of the variable.
The default value. Must be a literal scalar value suitable for the default clause of a user defined type member.
session |
keep the variable in the session; needs a login control to be present |
pagestate |
keep the variable in page view state |
temp |
do not keep variable |
0 |
same as 'pagestate' |
1 |
same as 'session' |
This specifies an optional name of a URL parameter for setting the page variable value. When this is specified and there is a parameter matching the name, the variable is set after it. This is a shorthand for an explicit call of keyword_get.
This attribute is for internal use only. It has no effect if added to the source VSPX file.
Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited. The value of this attribute will not be used when the resulting HTML is rendered.
Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited. The value of this attribute will not be used when the resulting HTML is rendered.
URI of the source document where the tag comes from.
Line number in the source document where the tag comes from.
This defines what sort of data are saved to the debugging log.
<?xml version="1.0"?> <!-- - - $Id: variable__0.vspx,v 1.2 2006/08/16 00:04:15 source Exp $ - - This file is part of the OpenLink Software Virtuoso Open-Source (VOS) - project. - - Copyright (C) 1998-2006 OpenLink Software - - This project is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; only version 2 of the License, dated June 1991. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - The v:variable element defines a new member of page class and hance we can access it with self.mask in rest of VSPX code.
<v:page name="variable__0" xmlns:v="http://www.openlinksw.com/vspx/"> <html> <head> <title>VSPX samples | v:variable</title> </head> <body> <v:variable name="mask" type="varchar" default="null"/> <?vsp self.mask := 'first value'; ?> <p>The variable value is set to '<?V self.mask ?>'</p> <?vsp self.mask := 'second value'; ?> <p>The variable value is set to '<?V self.mask ?>'</p> </body> </html> </v:page>