Edit D:\app\Administrator\product\11.2.0\dbhome_1\apex\images\doc\AEAPI\apex_item001.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> <meta http-equiv="Content-Type" content="text/html; charset=us-ascii" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <title>CHECKBOX Function</title> <meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1" /> <meta name="date" content="2009-04-14T17:32:16Z" /> <meta name="robots" content="noarchive" /> <meta name="doctitle" content="CHECKBOX Function" /> <meta name="relnum" content="Release 3.2" /> <meta name="partnum" content="E12510-01" /> <link rel="copyright" href="../dcommon/html/cpyr.htm" title="Copyright" type="text/html" /> <link rel="stylesheet" href="../dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" /> <link rel="contents" href="toc.htm" title="Contents" type="text/html" /> <link rel="up" href="preface" title="Home" type="text/html" /> <link rel="up" href="apex_item.htm" title="APEX_ITEM" type="text/html" /> <link rel="up" href="apex_item001.htm" title="CHECKBOX Function" type="text/html" /> <link rel="prev" href="apex_item.htm" title="Previous" type="text/html" /> <link rel="next" href="apex_item002.htm" title="Next" type="text/html" /> </head> <body> <p id="BREADCRUMBING"><a href="preface" title="Home">Home</a> > <a href="apex_item.htm" title="APEX_ITEM">APEX_ITEM</a> > CHECKBOX Function</p> <table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%"> <col width="86%" /> <col width="*" /> <tr valign="bottom"> <td align="left"></td> <td align="center"><a href="apex_item.htm"><img src="../dcommon/gifs/leftnav.gif" alt="Previous" /><br /> <span class="icon">Previous</span></a> </td> <td align="center"><a href="apex_item002.htm"><img src="../dcommon/gifs/rightnav.gif" alt="Next" /><br /> <span class="icon">Next</span></a></td> </tr> </table> <p><a id="CHDDCHAF" name="CHDDCHAF"></a></p> <hr /> <div class="refsect1"> <h1><a name="AEAPI193" id="AEAPI193"></a>CHECKBOX <a id="sthref519" name="sthref519"></a><a id="sthref520" name="sthref520"></a>Function</h1> <p>This function creates check boxes.</p> <a id="sthref521" name="sthref521"></a> <p class="subhead2">Syntax</p> <pre xml:space="preserve" class="oac_no_warn"> APEX_ITEM.CHECKBOX( p_idx IN NUMBER, p_value IN VARCHAR2 DEFAULT NULL, p_attributes IN VARCHAR2 DEFAULT NULL, p_checked_values IN VARCHAR2 DEFAULT NULL, p_checked_values_delimitor IN VARCHAR2 DEFAULT ':', p_item_id IN VARCHAR2 DEFAULT NULL, p_item_label IN VARCHAR2 DEFAULT NULL) RETURN VARCHAR2; </pre> <a id="sthref522" name="sthref522"></a> <p class="subhead2">Parameters</p> <p><a href="#CHDBHBBJ">Table: CHECKBOX Parameters</a> describes the parameters available in the <code>CHECKBOX</code> function.</p> <div class="tblformal"><a id="sthref523" name="sthref523"></a><a id="CHDBHBBJ" name="CHDBHBBJ"></a> <p class="titleintable">CHECKBOX Parameters</p> <table class="Formal" title="CHECKBOX Parameters" summary="This table describes the parameters available in CHECKBOX." dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0"> <col width="41%" /> <col width="*" /> <thead> <tr align="left" valign="top"> <th align="left" valign="bottom" id="r1c1-t2">Parameter</th> <th align="left" valign="bottom" id="r1c2-t2">Description</th> </tr> </thead> <tbody> <tr align="left" valign="top"> <td align="left" id="r2c1-t2" headers="r1c1-t2"> <p><code>p_idx</code></p> </td> <td align="left" headers="r2c1-t2 r1c2-t2"> <p>Number that determines which <code>APEX_APPLICATION</code> global variable will be used. Valid range of values is 1 to 50. For example 1 creates <code>F01</code> and 2 creates <code>F02</code></p> </td> </tr> <tr align="left" valign="top"> <td align="left" id="r3c1-t2" headers="r1c1-t2"> <p><code>p_value</code></p> </td> <td align="left" headers="r3c1-t2 r1c2-t2"> <p>Value of a check box, hidden field, or input form item</p> </td> </tr> <tr align="left" valign="top"> <td align="left" id="r4c1-t2" headers="r1c1-t2"> <p><code>p_attributes</code></p> </td> <td align="left" headers="r4c1-t2 r1c2-t2"> <p>Controls HTML tag attributes (such as disabled)</p> </td> </tr> <tr align="left" valign="top"> <td align="left" id="r5c1-t2" headers="r1c1-t2"> <p><code>p_checked_values</code></p> </td> <td align="left" headers="r5c1-t2 r1c2-t2"> <p>Values to be checked by default</p> </td> </tr> <tr align="left" valign="top"> <td align="left" id="r6c1-t2" headers="r1c1-t2"> <p><code>p_checked_values_delimitor</code></p> </td> <td align="left" headers="r6c1-t2 r1c2-t2"> <p>Delimits the values in the previous parameter, <code>p_checked_values</code></p> </td> </tr> <tr align="left" valign="top"> <td align="left" id="r7c1-t2" headers="r1c1-t2"> <p><code>p_item_id</code></p> </td> <td align="left" headers="r7c1-t2 r1c2-t2"> <p>HTML attribute ID for the <code><input></code> tag</p> </td> </tr> <tr align="left" valign="top"> <td align="left" id="r8c1-t2" headers="r1c1-t2"> <p><code>p_item_label</code></p> </td> <td align="left" headers="r8c1-t2 r1c2-t2"> <p>Invisible label created for the item</p> </td> </tr> </tbody> </table> <br /></div> <!-- class="tblformal" --> <a id="sthref524" name="sthref524"></a> <p class="subhead2">Examples of Default Check Box Behavior</p> <p>The following example demonstrates how to create a selected check box for each employee in the <code>emp</code> table.</p> <pre xml:space="preserve" class="oac_no_warn"> SELECT APEX_ITEM.CHECKBOX(1,empno,'CHECKED') "Select", ename, job FROM emp ORDER BY 1 </pre> <p>The following example demonstrates how to have all check boxes for employees display without being selected.</p> <pre xml:space="preserve" class="oac_no_warn"> SELECT APEX_ITEM.CHECKBOX(1,empno) "Select", ename, job FROM emp ORDER BY 1 </pre> <p>The following example demonstrates how to select the check boxes for employees who work in department 10.</p> <pre xml:space="preserve" class="oac_no_warn"> SELECT APEX_ITEM.CHECKBOX(1,empno,DECODE(deptno,10,'CHECKED',NULL)) "Select", ename, job FROM emp ORDER BY 1 </pre> <p>The next example demonstrates how to select the check boxes for employees who work in department 10 or department 20.</p> <pre xml:space="preserve" class="oac_no_warn"> SELECT APEX_ITEM.CHECKBOX(1,deptno,NULL,'10:20',':') "Select", ename, job FROM emp ORDER BY 1 </pre> <a id="sthref525" name="sthref525"></a> <p class="subhead2">Creating an On-Submit Process</p> <p>If you are using check boxes in your application, you might need to create an On Submit process to perform a specific type of action on the selected rows. For example, you could have a Delete button that utilizes the following logic:</p> <pre xml:space="preserve" class="oac_no_warn"> SELECT APEX_ITEM.CHECKBOX(1,empno) "Select", ename, job FROM emp ORDER by 1 </pre> <p>Consider the following sample on-submit process:</p> <pre xml:space="preserve" class="oac_no_warn"> FOR I in 1..APEX_APPLICATION.G_F01.COUNT LOOP DELETE FROM emp WHERE empno = to_number(APEX_APPLICATION.G_F01(i)); END LOOP; </pre> <p>The following example demonstrates how to create unselected checkboxes for each employee in the emp table, with a unique ID. This is useful for referencing records from within JavaScript code:</p> <pre xml:space="preserve" class="oac_no_warn"> SELECT APEX_ITEM.CHECKBOX(1,empno,NULL,NULL,NULL,'f01_#ROWNUM#') "Select", ename, job FROM emp ORDER BY 1 </pre></div> <!-- class="refsect1" --> <!-- Start Footer --> <div class="footer"> <table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%"> <col width="86%" /> <col width="*" /> <tr> <td align="left"><span class="copyrightlogo">Copyright © 2003, 2009, Oracle and/or its affiliates. All rights reserved.</span><br /> <a href="../dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td> <td align="center"><a href="apex_item.htm"><img src="../dcommon/gifs/leftnav.gif" alt="Previous" /><br /> <span class="icon">Previous</span></a> </td> <td align="center"><a href="apex_item002.htm"><img src="../dcommon/gifs/rightnav.gif" alt="Next" /><br /> <span class="icon">Next</span></a></td> </tr> </table> </div> <!-- class="footer" --> </body> </html>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de