Sophie

Sophie

distrib > Fedora > 14 > x86_64 > media > updates > by-pkgid > 71d40963b505df4524269198e237b3e3 > files > 954

virtuoso-opensource-doc-6.1.4-2.fc14.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
 <head profile="http://internetalchemy.org/2003/02/profile">
  <link rel="foaf" type="application/rdf+xml" title="FOAF" href="http://www.openlinksw.com/dataspace/uda/about.rdf" />
  <link rel="schema.dc" href="http://purl.org/dc/elements/1.1/" />
  <meta name="dc.title" content="OpenLink Virtuoso Universal Server: Documentation" />
  <meta name="dc.subject" content="OpenLink Virtuoso Universal Server: Documentation" />
  <meta name="dc.creator" content="OpenLink Software Documentation Team ;&#10;" />
  <meta name="dc.copyright" content="OpenLink Software, 1999 - 2009" />
  <link rel="top" href="index.html" title="OpenLink Virtuoso Universal Server: Documentation" />
  <link rel="search" href="/doc/adv_search.vspx" title="Search OpenLink Virtuoso Universal Server: Documentation" />
  <link rel="parent" href=".html" title="Chapter Contents" />
  <link rel="prev" href="index.html" title="Home" />
  <link rel="next" href="contents.html" title="Contents" />
  <link rel="shortcut icon" href="../images/misc/favicon.ico" type="image/x-icon" />
  <link rel="stylesheet" type="text/css" href="doc.css" />
  <link rel="stylesheet" type="text/css" href="/doc/translation.css" />
  <title>OpenLink Virtuoso Universal Server: Documentation</title>
  <meta http-equiv="Content-Type" content="text/xhtml; charset=UTF-8" />
  <meta name="author" content="OpenLink Software Documentation Team ;&#10;" />
  <meta name="copyright" content="OpenLink Software, 1999 - 2009" />
  <meta name="keywords" content="" />
  <meta name="GENERATOR" content="OpenLink XSLT Team" />
 </head>
 <body>
  <div id="header">
    <a name="vc_select_list" />
    <img src="../images/misc/logo.jpg" alt="" />
    <h1>OpenLink Virtuoso Universal Server: Documentation - select-list</h1>
  </div>
  <div id="navbartop">
   <div>
      <a class="link" href="functions.html">Chapter Contents</a> | <a class="link" href="index.html" title="Home">Prev</a> | <a class="link" href="contents.html" title="Contents">Next</a>
   </div>
  </div>
  <div id="currenttoc">
   <form method="post" action="/doc/adv_search.vspx">
    <div class="search">Keyword Search: <br />
        <input type="text" name="q" /> <input type="submit" name="go" value="Go" />
    </div>
   </form>
   <div>
      <a href="http://www.openlinksw.com/">www.openlinksw.com</a>
   </div>
   <div>
      <a href="http://docs.openlinksw.com/">docs.openlinksw.com</a>
   </div>
    <br />
   <div>
      <a href="index.html">Book Home</a>
   </div>
    <br />
   <div>
      <a href="contents.html">Contents</a>
   </div>
   <div>
      <a href="preface.html">Preface</a>
   </div>
    <br />
   <div>
      <a href="overview.html">Overview</a>
   </div>
   <div>
      <a href="installation.html">Installation Guide</a>
   </div>
   <div>
      <a href="quicktours.html">Quick Start &amp; Tours</a>
   </div>
   <div>
      <a href="sampleapps.html">Sample ODBC &amp; JDBC Applications</a>
   </div>
   <div>
      <a href="concepts.html">Conceptual Overview</a>
   </div>
   <div>
      <a href="server.html">Administration</a>
   </div>
   <div>
      <a href="accessinterfaces.html">Data Access Interfaces</a>
   </div>
   <div>
      <a href="sqlreference.html">SQL Reference</a>
   </div>
   <div>
      <a href="sqlprocedures.html">SQL Procedure Language Guide</a>
   </div>
   <div>
      <a href="hooks.html">Database Event Hooks</a>
   </div>
   <div>
      <a href="repl.html">Data Replication, Synchronization and Transformation Services</a>
   </div>
   <div>
      <a href="webappdevelopment.html">Web Application Development</a>
   </div>
   <div>
      <a href="webandxml.html">XML Support</a>
   </div>
   <div>
      <a href="rdfandsparql.html">RDF Data Access and Data Management</a>
   </div>
   <div>
      <a href="webservices.html">Web Services</a>
   </div>
   <div>
      <a href="runtimehosting.html">Runtime Hosting</a>
   </div>
   <div>
      <a href="internetservices.html">Internet Services</a>
   </div>
   <div>
      <a href="freetext.html">Free Text Search</a>
   </div>
   <div>
      <a href="tpcc.html">TPC C Benchmark Kit</a>
   </div>
   <div>
      <a href="xa.html">Using Virtuoso with Tuxedo</a>
   </div>
   <div>
      <a href="appendixa.html">Appendix</a>
   </div>
   <div>
      <a href="functions.html">Virtuoso Functions Guide</a>
   </div>
    <br />
  </div>
  <div id="text">
    <h2>select-list</h2>
    <div class="refpurpose">Fixed initialized select list.</div>
    <div class="funcsynopsis">
        <span class="funcdef">
            &lt;<a href="vc_select_list.html">
          <span class="function">select-list</span>
        </a> 
            name (required) 
          
            annotation (optional) 
          
            initial-enable (optional) 
          
            enabled (optional) 
          
            instantiate (optional) 
          
            control-udt (optional) 
          
            xsd-stub-xhtml (optional) 
          
            width (optional) 
          
            height (optional) 
          
            column (optional) 
          
            null-value (optional) 
          
            error-glyph (optional) 
          
            auto-submit (optional) 
          
            multiple (optional) 
          
            value (optional) 
          
            element-value (optional) 
          
            element-place (optional) 
          
            element-path (optional) 
          
            element-params (optional) 
          
            element-update-path (optional) 
          
            element-update-params (optional) 
          
            fmt-function (optional) 
          
            cvt-function (optional) 
          
            debug-srcfile (optional) 
          
            debug-srcline (optional) 
          
            debug-log (optional) 
 /&gt;</span>
    </div>
  
  
  
  <div class="refsect1">
    <div class="refsect1title">Description</div>
    <p>This is a scriptable version of HTML select control.
It shows a static list of items (see item element). Databind and on-post scripts are allowed.
</p>
  </div>
  <div class="refsect1">
    <div class="refsect1title">Attributes</div>
  <div class="formalpara">
   <strong>name = <a href="vc_type_SqlName.html">SqlName</a>
   </strong>
      <p>A page level unique name identifying a control.</p>
  </div>
  <div class="formalpara">
      <strong>annotation</strong>
      <p>A human readable comment.</p>
  </div>
  <div class="formalpara">
   <strong>initial-enable = <a href="vc_type_CalculateableValue.html">CalculateableValue</a>
   </strong>
      <p>Determines  whether  a control is initially visible. True by default. Could be data-bound to an SQL expression.</p>
  </div>
  <div class="formalpara">
   <strong>enabled = <a href="vc_type_CalculateableValue.html">CalculateableValue</a>
   </strong>
      <p>Determines  whether  a control is visible. True by default. Could be data-bound to an SQL expression.</p>
  </div>
  <div class="formalpara">
   <strong>instantiate = <a href="vc_type_CalculateableValue.html">CalculateableValue</a>
   </strong>
      <p>Determines whether a control instantiate its children. It is true by default. It could be data-bound to an SQL expression. Unlike most of calcucateable attributes, the value of this attribute for a control is calcluated before calling &#39;on-init&#39; event handler of the control; other values are calculated before calling &#39;before-data-bind&#39; event handler.</p>
  </div>
  <div class="formalpara">
   <strong>control-udt = <a href="vc_type_SqlName.html">SqlName</a>
   </strong>
      <p>At run time every control is represented as an instance of some user-defined type (UDT). VSPX compiles selects the UDT to use depending on name of the XML element that represents the control and maybe some of its attributes. In some specific cases the application developer may instruct VSPX compiler to use some other UDT, e.g. an application-specific UDT that is derived from the preset one. If specified, the value of &#39;control-udt&#39; attribute should be equal to the name of the desired target UDT.</p>
  </div>
  <div class="formalpara">
      <strong>xsd-stub-xhtml</strong>
      <p>This attribute is for internal use only. It has no effect if added to the source VSPX file.</p>
  </div>
  <div class="formalpara">
      <strong>width</strong>
      <p>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.</p>
  </div>
  <div class="formalpara">
      <strong>height</strong>
      <p>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.</p>
  </div>
  <div class="formalpara">
   <strong>column = <a href="vc_type_SqlName.html">SqlName</a>
   </strong>
      <p>The name of the column bound.
If nothing else is specified, the column meta data from the containing update form sets the field&#39;s attributes.
</p>
  </div>
  <div class="formalpara">
      <strong>null-value</strong>
      <p>This value will be shown if value of the column is NULL, also
	      value of the control will be set to null if this value is passed upon POST request.
	  </p>
  </div>
  <div class="formalpara">
      <strong>error-glyph</strong>
      <p>The character to be displayed near the resulting HTML input element if the test of v:validator of the element detects an error in the current value of the element.</p>
  </div>
  <div class="formalpara">
      <strong>auto-submit</strong>
      <p>Flag to auto submit the parent form if value of the control is changed.</p>
  </div>
  <div class="formalpara">
      <strong>multiple</strong>
      <p>Used to designate a multiple selection list box.
	    In this case the control&#39;s value will be an array of key data of selected items.
	  </p>
  </div>
  <div class="formalpara">
   <strong>value = <a href="vc_type_CalculateableValue.html">CalculateableValue</a>
   </strong>
      <p>Data bindable value of control, represents value of HTML control to be drawn.
The calculated value of this attribute is stored in the control in ufl_value field.
</p>
  </div>
  <div class="formalpara">
   <strong>element-value = <a href="vc_type_CalculateableValue.html">CalculateableValue</a>
   </strong>
      <p>An XML entity that contains a value to be displayed by an HTML control.
The calculated value is stored in ufl_element_value field of the control.
This value is used only if ufl_value is null (e.g. if the &#39;value&#39; attribute is not set at all), and the method vc_get_value_from_element() will be used to calculate ufl_value based on ufl_element_value, ufl_element_path and ufl_element_place.
</p>
  </div>
  <div class="formalpara">
   <strong>element-place = <a href="vc_type_CalculateableValue.html">CalculateableValue</a>
   </strong>
      <p>The place of actual data inside an XML element. The calculated value of this attribute is stored in ufl_element_place field of the control. This is to process XMLSchema-compatible data without writing extra code for handling NULL values. The XML element can contain the value to be bound in either attribute or in an inner text node. XMLSchema treats missing attributes as NULL values. missing text node as an empty string value and if &#39;xsi:nil&#39; attribute is &#39;true&#39; then inner text value is NULL no matter if there are any text nodes. These self-evident rules are convenient for XQuery data retrieval but not for data update: an result of some XQuery expression can point to data but not to a place where data should occur in the future.
The use of &#39;element-place&#39; allows to eliminate the problem. Attributes &#39;element-value&#39;, &#39;element-path&#39; and &#39;element-update-path&#39; may locate an element that is always present whereas &#39;element-place&#39; describes where the desired datum will occur in the element.
The value of this attribute should be a string of syntax &#39;@attributename&#39; or &#39;text()&#39;. If this is &#39;@attributename&#39; then the effective bound value is a value of the specified attribute or NULL if the specified attribute is missing. On update, either the attribute is created/edited in order to set non-NULL value or the attribute is deleted in order to set NULL.
If text() is specified then both text value of the element and the value of its &#39;xsi:nil&#39; are properly handled on both data bind and update.</p>
  </div>
  <div class="formalpara">
   <strong>element-path = <a href="vc_type_CalculateableValue.html">CalculateableValue</a>
   </strong>
      <p>This is the path inside the entity that comes from &#39;element-value&#39; attribute. The default path is &#39;self::node()&#39;. This path is used to point precisely to an subentity that should actually be used for data binding. The calculated value of this attribute should be a string in XQuery syntax, and it is saved in ufl_element_path member of the control.</p>
  </div>
  <div class="formalpara">
   <strong>element-params = <a href="vc_type_CalculateableValue.html">CalculateableValue</a>
   </strong>
      <p>This is the vector of parameter values of the path specified by &#39;element-path&#39; attribute. The default is NULL indicating no parameters. The attribute is calculated but not used if &#39;element-path&#39; attribute is missing. The calculated value of this attribute should be either NULL or a vector of even length whose items are parameter names and parameter values; refer to the description of xquery_eval() function for more details. The value of the attribute is saved in ufl_element_params member of the control.</p>
  </div>
  <div class="formalpara">
   <strong>element-update-path = <a href="vc_type_CalculateableValue.html">CalculateableValue</a>
   </strong>
      <p>Like the value of &#39;element-path&#39;, this is the path inside the entity that comes from &#39;element-value&#39; attribute. The difference is that &#39;element-path&#39; is used inside &#39;vc_get_value_from_element() during data-bind to set ufl_value based on ufl_element_value whereas &#39;element-update-path&#39; is used during data update inside &#39;vc_put_value_to_element() in order to save data inside the document that is referenced by ufl_element_value. The default path for update is equal to the path for data bind, i.e. it is the value of the calculated &#39;element-path&#39; attribute or &#39;self::node()&#39;. The calculated value of &#39;element-update-path&#39; should be a string in XQuery syntax, and it is saved in ufl_element_update_path member of the control.</p>
  </div>
  <div class="formalpara">
   <strong>element-update-params = <a href="vc_type_CalculateableValue.html">CalculateableValue</a>
   </strong>
      <p>This is the vector of parameter values of the path specified by &#39;element-update-path&#39; attribute. The default is NULL indicating no parameters. The attribute is calculated but not used if &#39;element-update-path&#39; attribute is missing (e.g. you should not try to specify &#39;element-path&#39; without &#39;element-update-path&#39; and both &#39;element-params&#39; and &#39;element-update-params&#39; in hope that values from &#39;element-update-params&#39; will be passed to &#39;element-path&#39; on update). The calculated value of this attribute should be either NULL or a vector of even length whose items are parameter names and parameter values; refer to the description of xquery_eval() function for more details. The value of the attribute is saved in ufl_element_update_params member of the control.</p>
  </div>
  <div class="formalpara">
   <strong>fmt-function = <a href="vc_type_CalculateableValue.html">CalculateableValue</a>
   </strong>
      <p>This is to convert the value that is bound to the control into a string to use during the rendering. The value of this attribute should be a name of function that takes a single argument of the type that matches the type of ufl_value and returns a string. If this is used then the value of &#39;cvt-function&#39; should probably be a name of function that converts the string back to the desired data type.
If a control supports &#39;format&#39; attribute then the format is applied to the result of &#39;fmt-function&#39;, so the value returned by fmt-function may be e.g. an integer to be formatted by &#39;%d&#39; format.
The calculated value of this attribute is stored in ufl_fmt_fn field of the control.</p>
  </div>
  <div class="formalpara">
   <strong>cvt-function = <a href="vc_type_CalculateableValue.html">CalculateableValue</a>
   </strong>
      <p>This is to convert a user input of type varchar into a value that should be stored in ufl_value (and e.g. placed into some database column by an update).
The calculated value of this attribute is stored in ufl_cvt_fn field of the control.
For more details, see the description of &#39;fmt_function&#39; attribute above.</p>
  </div>
  <div class="formalpara">
      <strong>debug-srcfile</strong>
      <p>URI of the source document where the tag comes from.</p>
  </div>
  <div class="formalpara">
      <strong>debug-srcline</strong>
      <p>Line number in the source document where the tag comes from.</p>
  </div>
  <div class="formalpara">
      <strong>debug-log</strong>
      <p>This defines what sort of data are saved to the debugging log.
</p>
  </div>
  </div>
  <div class="refsect1">
    <div class="refsect1title">Declaration of type vspx_select_list</div>
    <p>
</p>
    <div>
        <pre class="screen">
create type vspx_select_list under vspx_field
as (
     vsl_items any,
     vsl_item_values any,
     vsl_selected_inx any default null,
     vsl_change_script int default 0,
     vsl_list_document any default null,
     vsl_list_match varchar default null,
     vsl_list_key_path varchar default null,
     vsl_list_value_path varchar default null,
     vsl_multiple int default 0
   )
  temporary self as ref
 overriding method vc_render () returns any,
 overriding method vc_view_state (stream any, n int) returns any,
 overriding method vc_set_view_state (e vspx_event) returns any,
 overriding method vc_set_model () returns any,
 overriding method vc_xrender () returns any,
 method vs_set_selected () returns any,
constructor method vspx_select_list (name varchar, parent vspx_control)
</pre>
      </div>
  </div>
  <div class="refsect1">
    <div class="refsect1title">Examples</div>
   <a name="vc_ex_select_list__0" />
      <div class="example">
      <div class="exampletitle">
  A simple static select list
</div>
      <p>
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;!--
 -  
 -  $Id: select_list__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 form of the sample page contains a list of three items.

</p>
      <div>
          <pre class="screen">
&lt;v:page name=&quot;select_list__0&quot; xmlns:v=&quot;http://www.openlinksw.com/vspx/&quot;&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;title&gt;VSPX samples | v:select-list&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;v:form name=&quot;form1&quot; type=&quot;simple&quot; action=&quot;&quot; method=&quot;POST&quot;&gt;
        &lt;v:select-list name=&quot;sel_list&quot;&gt;
          &lt;v:item name=&quot;*default*&quot; value=&quot;0&quot;/&gt;
          &lt;v:item name=&quot;FIRST&quot; value=&quot;1&quot;/&gt;
          &lt;v:item name=&quot;SECOND&quot; value=&quot;2&quot;/&gt;
        &lt;/v:select-list&gt;
        &lt;v:button name=&quot;submit1&quot; action=&quot;simple&quot; value=&quot;OK&quot;/&gt;
      &lt;/v:form&gt;
    &lt;/body&gt;
  &lt;/html&gt;
&lt;/v:page&gt;
</pre>
        </div>
   </div>
  </div>
  <div class="tip">
    <div class="tiptitle">See Also: Reference Material in the Tutorial:</div>
   <p>
      <a href="/tutorial/web/vx_s_2/select.vspx">VX-S-2</a>
   </p>
  </div>
</div>
  <div id="footer">
    <div>Copyright© 1999 - 2009 OpenLink Software All rights reserved.</div>
   <div id="validation">
    <a href="http://validator.w3.org/check/referer">
        <img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" />
    </a>
    <a href="http://jigsaw.w3.org/css-validator/">
        <img src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" height="31" width="88" />
    </a>
   </div>
  </div>
 </body>
</html>