Edit D:\app\Administrator\product\11.2.0\dbhome_1\apex\images\doc\tutorial\frm_tabular.htm
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <!-- Run date = February 23, 2005 16:58:37 --> <meta name="Generator" content=" Oracle DARB XHTML converter - Version 4.1.3 Build 116" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <title> How to Create a Tabular Form </title> <link rel="stylesheet" type="text/css" href="blafdoc.css" title="default" /> <link rel="stylesheet" type="text/css" href="darbbook.css" title="default" /> <link rel="prev" href="preface.htm" title="Previous" /> <link rel="next" href="rprt_query.htm" title="Next" /> <link rel="up" href="toc.htm" title="Up" /> <link rel="contents" href="toc.htm" title="Contents" /> <link rel="copyright" href="./support/html/cpyr.htm" title="Copyright" /> <link rel="index" href="index.htm" title="Index" /> </head> <body> <div class="header"> <a id="top" name="top"></a> <table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%"> <tr> <td align="left" valign="top"> <b>Oracle® HTML DB Guide to Building Applications </b> <br /> <b>Release 2.0 </b> </td> <td valign="bottom" align="right"> <table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="225"> <tr><td> </td> <td align="center" valign="top"><a href="toc.htm"><img src="./support/gifs/toc.gif" alt="Go To Table Of Contents" border="0" /><br /><span class="icon">Contents</span></a></td> </table> </td> </tr> </table> <hr /> <table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100"> <tr> <td align="center"> <a href="preface.htm"> <img src="./support/gifs/leftnav.gif" alt="Previous" border="0" /><br /><span class="icon">Previous</span></a> </td> <td align="center"> <a href="rprt_query.htm"> <img src="./support/gifs/rightnav.gif" alt="Next" border="0" /><br /><span class="icon">Next</span></a> </td> <td> </td> </tr> </table> </div><!-- class="header" --> <div class="IND"> <!-- End Header --><a id="CHDFBHDB" name="CHDFBHDB"></a><a id="sthref25" name="sthref25"></a> <h1><a name="HTMAD001"></a>How to Create a Tabular Form </h1> <p>A tabular form enables users to update multiple rows in a table at once using a single page. You can use the Tabular Form Wizard to create a tabular form that contains a built-in multiple row update process. This built-in process performs optimistic locking behind the scenes to maintain the data integrity. </p> <p>This tutorial explains how to create a tabular form within an existing application and then how to change one of the updatable columns from a text field to a select list. </p> <p class="subhead2">Topics:</p> <ul> <li type="disc"> <p><a href="#CHDBFJEG">About Sample Application</a> </p> </li> <li type="disc"> <p><a href="#CIHJGJCI">Creating a Tabular Form Using a Wizard</a> </p> </li> <li type="disc"> <p><a href="#CHDIGEEB">Changing Updatable Column Display Type</a> </p> </li> </ul><a id="CHDBFJEG" name="CHDBFJEG"></a> <div class="sect1"> <!-- infolevel=all infotype=General --><a id="sthref26" name="sthref26"></a> <h2>About Sample Application </h2> <p>Oracle HTML DB installs with a number of demonstration applications. In this exercise you will create a tabular form within the demonstration application, <span class="italic">Sample Application</span>. </p> <p>To see if <span class="italic">Sample Application</span> is installed: </p> <ol type="1" start="1"> <li> <p>Log in to Oracle HTML DB. </p> </li> <li> <p>From the Workspace Administration list, select <span class="bold">Review Demonstration Applications</span>. </p> </li> <li> <p>Locate Sample Application and check the Status column: </p> <ol type="a"> <li> <p>If the Status column displays <span class="bold">Installed</span>, return to the Workspace home page. </p> </li> <li> <p>If the Status column displays <span class="bold">Not Installed</span>, select <span class="bold">Install</span> in the Action column. </p> </li> <li> <p>Follow the on-screen instructions. </p> </li> </ol> </li> </ol> </div><!-- class="sect1" --> <a id="CIHJGJCI" name="CIHJGJCI"></a> <div class="sect1"> <!-- infolevel=all infotype=General --><a id="sthref27" name="sthref27"></a> <h2>Creating a Tabular Form Using a Wizard </h2> <p>The Tabular Form Wizard creates a form to perform update, insert, and delete operations on multiple rows in a database table. Additionally, the wizard creates a multiple row update process that checks for MD5 checksum values before doing the update in order to prevent lost updates. The following exercise creates a tabular form on the <code>EMP</code> table. </p> <p>To create a tabular form using the Tabular Form Wizard: </p> <ol type="1" start="1"> <li> <p>Navigate to the Workspace home page. </p> </li> <li> <p>From the Applications list, select <span class="bold">Sample Application</span>. </p> </li> <li> <p>Click <span class="bold">Create Page</span>. </p> </li> <li> <p>On Create New Page, select <span class="bold">Page with Component</span> and click <span class="bold">Next</span>. </p> </li> <li> <p>On Select Component Type, select <span class="bold">Form</span> and click <span class="bold">Next</span>. </p> </li> <li> <p>On Create Page, select <span class="bold">Tabular Form</span> and click <span class="bold">Next</span>. </p> </li> <li> <p>On Identify Table/View Owner: </p> <ol type="a"> <li> <p>From Table/View Owner, select the owner of the <code>EMP</code> table. </p> </li> <li> <p>From Allowed Operations, accept the default. </p> </li> <li> <p>Click<span class="bold"> Next</span>. </p> </li> </ol> </li> <li> <p>For Table/View Name, select <span class="bold">EMP</span> and click <span class="bold">Next</span>. </p> </li> <li> <p>On Identify Columns to Display: </p> <ol type="a"> <li> <p>For Use User Interface Defaults, accept the default. </p> </li> <li> <p>For Select Columns, select the following columns: </p> <pre xml:space="preserve" class="oac_no_warn">ENAME, JOB, HIREDATE, SAL, COMM </pre> <div align="center"> <div class="inftblNote"> <br /><table class = "Note oac_no_warn" summary="This is a layout table to format a note" title="This is a layout table to format a note" dir="ltr" border="1" width="80%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0"> <tbody> <tr> <td align="left"> <p class="notep1">Note:</p>This exercise limits the number of columns to optimize the display on-screen. For a real form, you would probably want to include additional columns. </td> </tr> </tbody> </table><br /> </div><!-- class="inftblNote --> </div> </li> <li> <p>Click <span class="bold">Next</span>. </p> </li> </ol> </li> <li> <p>For Primary Key Column 1, accept the default <span class="bold">EMPNO</span> and click <span class="bold">Next</span>. </p> </li> <li> <p>For Source Type, accept the default <span class="bold">Existing trigger</span> and click <span class="bold">Next</span>. </p> </li> <li> <p>For Updatable Columns, select the following columns and click <span class="bold">Next</span>: </p> <pre xml:space="preserve" class="oac_no_warn">JOB, HIREDATE, SAL, COMM </pre> </li> <li> <p>On Identify Page and Region Attributes: </p> <ol type="a"> <li> <p>For Page, enter <code>800</code>. </p> </li> <li> <p>For Page Name, enter <code>Tabular Form on EMP</code>. </p> </li> <li> <p>For Region Name, enter <code>Tabular Form on EMP</code>. </p> </li> <li> <p>Click <span class="bold">Next</span>. </p> </li> </ol> </li> <li> <p>On Identify Tab, accept the default, <span class="bold">Do not use tabs,</span> and click <span class="bold">Next</span>. </p> </li> <li> <p>On Button Labels: </p> <ol type="a"> <li> <p>Accepts the defaults for the Cancel, Delete, and Add Row buttons. </p> </li> <li> <p>For the Submit button, enter <code>Apply Changes</code>. </p> </li> <li> <p>Click <span class="bold">Next</span>. </p> </li> </ol> </li> <li> <p>Accept the remaining defaults, click <span class="bold">Next</span>, and then click <span class="bold">Finish</span>. </p> </li> </ol> <p>Next, run the page to view your new form. </p> <p>To run the page: </p> <ol type="1" start="1"> <li> <p>Click <span class="bold">Run Page</span>. </p> </li> <li> <p>If prompted to enter a username and password: </p> <ol type="a"> <li> <p>For User Name, enter either <code>demo</code> or <code>admin</code>. </p> </li> <li> <p>For Password, enter the name of the current workspace using all lowercase letters. </p> </li> <li> <p>Click <span class="bold">Login</span>. </p> </li> <li> <p>Navigate to page 800: </p> <ul> <li type="circle"> <p>Select <span class="bold">Edit Page</span> from the Developer Toolbar. </p> </li> <li type="circle"> <p>In Page, enter <span class="bold">800</span> and click <span class="bold">Go</span>. </p> </li> <li type="circle"> <p>Click the Run Page icon. </p> </li> </ul> </li> </ol> </li> </ol> <p>As shown in <a href="#CHDJDFEF">Figure 1-1</a>, note the tabular form contains four buttons. Cancel, Delete, and Apply Changes display in the upper right corner and Add Row displays at the bottom. Additionally, a check box appears to the left of each row enabling the user to select one row at a time, or a user can select all rows at once by selecting the check box to the left of the column headings. The check box is used in conjunction with the Delete button to identify the rows to be deleted. </p> <div class="figure"> <a id="CHDJDFEF" name="CHDJDFEF"></a><a id="sthref28" name="sthref28"></a> <p class="titleinfigure">Figure 1-1 Tabular Form on the EMP Table</p> <img src="./img/tab_frm_1.gif" alt="Description of tab_frm_1.gif follows" title="Description of tab_frm_1.gif follows"/> <br /><a id="sthref29" name="sthref29" href="./img_text/tab_frm_1.htm">Description of the illustration tab_frm_1.gif</a> <br /><br /> </div><!-- class="figure" --> </div><!-- class="sect1" --> <a id="CHDIGEEB" name="CHDIGEEB"></a> <div class="sect1"> <!-- infolevel=all infotype=General --><a id="sthref30" name="sthref30"></a> <h2>Changing Updatable Column Display Type </h2> <p>When the Tabular Form Wizard creates a tabular form, updatable columns display by default as text field. You can change this default display by editing report column attributes. </p> <p>To change the default display of <code>JOB</code> to a select list: </p> <ol type="1" start="1"> <li> <p>Navigate to the Page Definition for page 800. Select <span class="bold">Edit Page</span> from the Developer Toolbar. </p> </li> <li> <p>Under Regions, click <span class="bold">Q</span> next to Tabular Form. </p> <p>The Region Attributes page appears. </p> </li> <li> <p>Under Report Column Attributes, click the Edit icon next to the JOB column. </p> </li> <li> <p>Scroll down to Tabular Form Element. From Display As, select <span class="bold">Select List (query based LOV)</span>. </p> </li> <li> <p>Under List of Values, enter the following LOV query: </p> <pre xml:space="preserve" class="oac_no_warn">SELECT DISTINCT job a, job b FROM emp </pre> </li> <li> <p>Click <span class="bold">Apply Changes</span>. </p> </li> <li> <p>Click the <span class="bold">Run Page</span> icon in the upper right corner the page. </p> <p>As shown in <a href="#CHDEFIJG">Figure 1-2</a>, notice the Job column now displays as a select list. </p> <div class="figure"> <a id="CHDEFIJG" name="CHDEFIJG"></a><a id="sthref31" name="sthref31"></a> <p class="titleinfigure">Figure 1-2 Job Column Changed to a Select List</p> <img src="./img/tab_frm_lst.gif" alt="Description of tab_frm_lst.gif follows" title="Description of tab_frm_lst.gif follows"/> <br /><a id="sthref32" name="sthref32" href="./img_text/tab_frm_lst.htm">Description of the illustration tab_frm_lst.gif</a> <br /><br /> </div><!-- class="figure" --> </li> </ol> <div align="center"> <div class="inftblNote"> <br /><table class = "Note oac_no_warn" summary="This is a layout table to format a note" title="This is a layout table to format a note" dir="ltr" border="1" width="80%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0"> <tbody> <tr> <td align="left"> <p class="notep1">Note:</p>Do not modify the select list of a SQL statement of a tabular form after it has been generated. Doing so can result in a checksum error when altering data of the form and applying updates. <p>Consider the following example: </p> <pre xml:space="preserve" class="oac_no_warn">SELECT ename FROM emp; </pre> <p>Note that this should not be altered to: </p> <pre xml:space="preserve" class="oac_no_warn">SELECT lower(ename) FROM emp </pre> </td> </tr> </tbody> </table><br /> </div><!-- class="inftblNote --> </div> </div><!-- class="sect1" --> </div> <!-- Start Footer --> <div class="footer"> <hr /> <table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%"> <tr> <td valign="bottom" width="33%"> <table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100"> <tr><td> </td> <td align="center"> <a href="preface.htm"> <img src="./support/gifs/leftnav.gif" alt="Previous" border="0" /><br /><span class="icon">Previous</span></a> </td> <td align="center"> <a href="rprt_query.htm"> <img src="./support/gifs/rightnav.gif" alt="Next" border="0" /><br /><span class="icon">Next</span></a> </td> </tr> </table> </td> <td class="copyrightlogo"> <a href="./support/html/cpyr.htm"> <span class="copyrightlogo"> Copyright © 2005, Oracle. All rights reserved. </span> </a> </td> <td valign="bottom" align="right" width="33%"> <table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="225"> <tr><td> </td> <td align="center" valign="top"><a href="toc.htm"><img src="./support/gifs/toc.gif" alt="Go To Table Of Contents" border="0" /><br /><span class="icon">Contents</span></a></td> </table> </td> </tr> </table> </div><!-- class="footer" --> </body> </html>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de