1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
|
<!--
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2018 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
-
-
-->
<refentry id="vspx_variable">
<refmeta>
<refentrytitle>vspx_variable</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>vspx_variable</refname>
<refpurpose>page variable</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="syn_vspx_variable">
<funcprototype id="proto_vspx_variable">
<funcdef>
<function>variable</function>
</funcdef>
<attributes>
<attribute>name (required) </attribute>
<attribute>type (required) </attribute>
<attribute>default (optional) </attribute>
</attributes>
<childs />
<class>
<screen><![CDATA[
-- no class for it, member of page class will be added when compiling page
]]>
</screen>
</class>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="desc_vspx_variable">
<title>Description</title>
<para>
<function>vspx_variable</function>A member of the UDT that is created for the page.
This tag declares a data member for the page subclass corresponding to the containing page. The value will be preserved between consecutive postbacks. The value will be initialized to the default when the page is accessed from some other page.
The attribute "persist" means to save its value to session table for inter-page usage, this can be done only when vspx:login control is included and authentication is performed.
</para>
</refsect1>
<refsect1 id="attrs_vspx_variable">
<title>Attributes</title>
<refsect2>
<title>name</title>
<para>The name of page class member
</para>
</refsect2>
<refsect2>
<title>type</title>
<para>The SQL datatype to be declared as.
</para>
</refsect2>
<refsect2>
<title>default</title>
<para>The default value of it. Must be scalar value only, soever specified for defaults of UDT class members.
</para>
</refsect2>
</refsect1>
<refsect1 id="childs_vspx_variable">
<title>Children</title>
</refsect1>
<refsect1 id="examples_vspx_variable">
<title>Examples</title>
<example id="ex_vspx_variable">
<title>Simple example</title>
<para>A page variable declaration, this will define a new member of page class and hance we can access it with self.mask in rest of VSPX code.
</para>
<screen><![CDATA[
<v:page name="variable_demo01" xmlns:v="http://example.com/vspx/">
<v:variable name="mask" type="varchar" default="null" />
<?vsp
self.mask := 'test';
http (self.mask);
?>
</v:page>
]]>
</screen>
</example>
</refsect1>
</refentry>
|