Sophie

Sophie

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

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_form" />
    <img src="../images/misc/logo.jpg" alt="" />
    <h1>OpenLink Virtuoso Universal Server: Documentation - form</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>form</h2>
    <div class="refpurpose">Generic scriptable container for elements that may accept user&#39;s input.</div>
    <div class="funcsynopsis">
        <span class="funcdef">
            &lt;<a href="vc_form.html">
          <span class="function">form</span>
        </a> 
            name (required) 
          
            annotation (optional) 
          
            initial-enable (optional) 
          
            enabled (optional) 
          
            instantiate (optional) 
          
            control-udt (optional) 
          
            xsd-stub-xhtml (optional) 
          
            width (optional) 
          
            height (optional) 
          
            type (optional) 
          
            action (optional) 
          
            method (optional) 
          
            table (optional) 
          
            if-not-exists (optional) 
          
            concurrency (optional) 
          
            triggers (optional) 
          
            data-source (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 grouping element for controls that handle post data and validation of user&#39;s input. In case of type &#39;update&#39;, this is a single row update control for a database table.
This retrieves the data from the row identified by the keys and shows the data in the column bound fields enclosed.  If responding to a post for a submit inside this form, the form updates/inserts the data and shows the resulting state at the render pass.
</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>type</strong>
      <p>Type of form, can be &#39;simple&#39; or &#39;update&#39;. When this is &#39;simple&#39; the vspx_form class will be instantiated, otherwise in case of &#39;update&#39; vspx_update_form subclass will be used.</p>
   <table class="data">
        <caption>Table: 12.4.9.1. Allowed values of the &#39;type&#39; attribute</caption>
    
     
      <tr>
              <td class="data">simple</td>
       <td class="data">
                <p>
Form with no special data binding.
</p>
       </td>
      </tr>
      <tr>
              <td class="data">update</td>
       <td class="data">
                <p>
Form that may be used in templates of type &#39;update&#39; or &#39;add&#39;.
</p>
       </td>
      </tr>
     
    
   </table>
        <br />
  </div>
  <div class="formalpara">
      <strong>action</strong>
      <p>
      A URL for processing. The data filled-in the form will be submitted to the &#39;action&#39; page.
      Therefore this is a page where the content of that form will be processed.
      If it is empty, the target is a current page.
				 </p>
  </div>
  <div class="formalpara">
      <strong>method</strong>
      <p>A method  of transferring the form data, can be POST or GET. The same as &#39;method&#39; of HTML forms.</p>
      <p>The use of &#39;GET&#39; is not recommended because the length of the URI may easily exceed internal limits of the browser or an intermediate proxy server.</p>
  </div>
  <div class="formalpara">
      <strong>table</strong>
      <p>If the value of &#39;type&#39; attribute is &#39;update&#39;, the form acts as a single row update control for a database table; and the value of &#39;table&#39; attribute specifies the name of that table.
It retrieves the data from the row identified by the keys and shows the data in the column bound fields enclosed.  If responding to a post for a submit inside this form, the form updates/inserts the data and shows the resulting state at the render pass.
This attribute is required if &#39;type&#39; is &#39;update&#39; and prohibited otherwise.</p>
  </div>
  <div class="formalpara">
      <strong>if-not-exists</strong>
      <p>If the keys do not select any row, and the value of this attribute is &#39;insert&#39;, the update form will be filled in with defaults filled in and will do an insert into the table when the form is submitted.
In this case of course the keys will have to be defaulted after the post or will have to be supplied in the post as fields.
Any defaulting should take place in the v:on-post handler which is before the insert or update in the event of the post.
</p>
  </div>
  <div class="formalpara">
      <strong>concurrency</strong>
      <p>If true and a previous value was shown in the form before the post being processed, this causes the system to check whether any of the data has been updated between getting it and the post at hand.
This is a sort of optimistic concurrency control at the row level.  If an update is detected, the updated_meanwhile message is set as the error message of the form and no update is made.  The render pass may choose to process this message as it will, the default is to show it as any other error message for form level validation failure.
</p>
  </div>
  <div class="formalpara">
      <strong>triggers</strong>
      <p>This is applicable for update form only, when this is OFF no PL triggers
	will be fired when inserting or updating.</p>
  </div>
  <div class="formalpara">
   <strong>data-source = <a href="vc_type_SqlName.html">SqlName</a>
   </strong>
      <p>This is applicable to the update form and is
	An alternative of &#39;table&#39;. When is specified the value is suppsed to be
	valid reference to existing data-source control. Further the given data-source
	will be used to bind/update the data.
      </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_form</div>
    <p>
</p>
    <div>
        <pre class="screen">
create type vspx_form under vspx_control
   as
     (
       uf_action varchar default &#39;&#39;,
       uf_method varchar default &#39;post&#39;,
       --uf_inside_form int default 0,
       uf_validators any,
       uf_xmodel any default null,
       uf_xsubmit any default null,
       uf_xschema any default null
     )  temporary self as ref
   constructor method vspx_form (name varchar, parent vspx_control),
   method prologue_render (sid varchar, realm varchar, nonce varchar) returns any,
   method epilogue_render () returns any,
   overriding method vc_set_model () returns any
</pre>
      </div>
  </div>
  <div class="refsect1">
    <div class="refsect1title">Examples</div>
   <a name="vc_ex_form__0" />
      <div class="example">
      <div class="exampletitle">
  Simple entry form
</div>
      <p>
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;!--
 -  
 -  $Id: form__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 OK button of the form submits data from the form back to the same page.

</p>
      <div>
          <pre class="screen">
&lt;v:page name=&quot;form__0&quot; xmlns:v=&quot;http://www.openlinksw.com/vspx/&quot;&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;title&gt;VSPX samples | v:form&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:label name=&quot;label1&quot; value=&quot;--&#39;Simple form&#39;&quot;/&gt;
        &lt;v:text name=&quot;txt1&quot; default=&quot;&quot;/&gt;
        &lt;v:text name=&quot;txt2&quot; default=&quot;&quot;/&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>
   <a name="vc_ex_form__1" />
      <div class="example">
      <div class="exampletitle">
  Simple entry form containing various controls
</div>
      <p>
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;!--
 -  
 -  $Id: form__1.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 OK button of the form submits data from the form back to the same page.
the check-box is validated against ragio group

</p>
      <div>
          <pre class="screen">
&lt;v:page name=&quot;form__1&quot; xmlns:v=&quot;http://www.openlinksw.com/vspx/&quot;&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;title&gt;VSPX samples | v:form | v:validator&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;v:form name=&quot;f1&quot; type=&quot;simple&quot; method=&quot;POST&quot;&gt;
	&lt;v:error-summary/&gt;&lt;br/&gt;
        &lt;v:label name=&quot;l1&quot; value=&quot;--&#39;Simple form&#39;&quot;/&gt;&lt;br/&gt;
        &lt;v:url name=&quot;u1&quot; value=&quot;--&#39;This page&#39;&quot; url=&quot;--self.f1.uf_action&quot; /&gt;&lt;br/&gt;
        &lt;v:text name=&quot;t1&quot; value=&quot;--self.rb1.ufl_value&quot;/&gt;&lt;br/&gt;
        &lt;v:text name=&quot;t2&quot; value=&quot;--&#39;my&#39;||&#39;password&#39;&quot; type=&quot;password&quot;/&gt;&lt;br/&gt;
        &lt;v:text name=&quot;t3&quot; value=&quot;--&#39;something&#39;||&#39;hidden&#39;&quot; type=&quot;hidden&quot;/&gt;
	&lt;v:textarea name=&quot;ta1&quot; value=&quot;--&#39;some text&#39;&quot; /&gt;&lt;br/&gt;
        &lt;v:check-box name=&quot;cb1&quot; value=&quot;check-box&quot; /&gt;&lt;br/&gt;
	&lt;v:radio-group name=&quot;rg1&quot;&gt;
	 &lt;v:radio-button name=&quot;rb1&quot; value=&quot;one&quot; /&gt;
	 &lt;v:radio-button name=&quot;rb2&quot; value=&quot;two&quot; /&gt;
        &lt;/v:radio-group&gt;&lt;br/&gt;
        &lt;v:button name=&quot;b1&quot; action=&quot;simple&quot; value=&quot;--&#39;OK&#39;&quot;/&gt;&lt;br/&gt;
 	&lt;v:validator test=&quot;sql&quot; message=&quot;only when radio is on position one check-box could be checked&quot;&gt;
	if (self.rb2.ufl_selected and self.cb1.ufl_selected)
	  {
	    return 1;
	  }
	&lt;/v:validator&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/form.vspx">VX-S-2</a>
   </p>
   <p>
      <a href="/tutorial/web/vx_s_3/update_form.vspx">VX-S-3</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>