当前位置: 首页 > 网络学院 > 客户端脚本教程 > APPML > elements

APPML
AppML HTML 报告
AppML 过滤函数
AppML HTML 列表
AppML HTML 表单
AppML XML 报告

APPML 中的 elements


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 327 ::
收藏到网摘: n/a

The <elements> element is a container for the data fields in an HTML form or in an editable HTML list that should fulfill special criterions.
<elements>元素作用是:为一个可编辑的HTML列表中指定数据字段的容器,它符合指定的标准以及条件。


<elements> Child Elements
<elements>子元素

The <elements> element may have the following child elements:
<element>元素可以包含下面这些子元素:

Element
元素
Description
描述
field Specifies criterions for a data field
为一个数据字段指定一个标准


Example of creating required fields:
案例:创建必要字段:

<?xml version="1.0" ?>
<appml>
<database>
<connection>northwind</connection>
<keyfield type="text">customerid</keyfield>
<maintable>customers</maintable>
<sql>SELECT CompanyName,ContactName,City FROM Customers</sql>
</database>
<htmllist />
<htmlform>
<elements> <field name="companyname"><required /></field> <field name="city"><required /></field> </elements> </htmlform>
</appml>

Click on the folder image in the list to enter the input form. Remove the text in the "Companyname" or "City" input field, then move to another field or click the "Submit" button. The field(s) will be yellow and an error message tells that the field is required.
点击列表中的文件夹图形来进入输入表单。删除"公司名称" 或 "城市"输入字段中的文本,此时,移动到另一个字段处,或者点击“提交”按钮;字段将呈现黄色,并且会产生一个错误消息。

View the output produced by the AppML HTML List Service
查看由AppML HTML 报告服务输出的结果

View the XML source file
查看XML 源文件

Example of a field that changes when changing another field:
案例:当改变其它字段的同时改变某字段:

<?xml version="1.0" ?><appml>

<title>Products</title>

<database>
<connection>northwind</connection>
<keyfield>productid</keyfield>
<maintable>products</maintable>
</database>

<filters>
<orderby>productname</orderby>
</filters>

<htmllist>
<sql>
SELECT products.productname AS Product,
suppliers.companyname AS Supplier,
categories.categoryname AS Category
FROM ((Products
LEFT JOIN suppliers ON
products.supplierid=suppliers.supplierid)
LEFT JOIN categories ON
products.categoryid=categories.categoryid)
</sql>
</htmllist>

<htmlform>
<sql>
SELECT productname,supplierid,products.categoryid,
quantityperunit,unitprice,categories.description
FROM (products
LEFT JOIN categories ON products.categoryid=categories.categoryid)
</sql>

<elements> <field name="description"><submit>false</submit></field> <field name="categoryid"> <onchange> <function name="selectfields"> <sql>SELECT description FROM categories WHERE categoryid=#appml:field(name="categoryid")</sql> </function> </onchange> </field> </elements> <form> <table> <tr> <td>Product</td> <td><input size="50" maxlength="40" id="productname" /></td> </tr> <tr> <td>Category</td> <td> <field name="categoryid"> <function name="dbselect"> <sql>SELECT categoryid,categoryname FROM categories ORDER BY categoryname</sql> <value>categoryid</value> <options>categoryname</options> </function> </field> </td> </tr> <tr> <td>Categorydescription</td> <td><input size="50" disabled="disabled" id="description" /></td> </tr> <tr> <td>Supplier</td> <td> <field name="supplierid"> <function name="dbselect"> <sql>SELECT supplierid,companyname FROM suppliers ORDER BY companyname</sql> <value>supplierid</value> <options>companyname</options> </function> </field> </td> </tr> <tr> <td>Quantity per unit</td> <td><input size="50" maxlength="20" id="quantityperunit" /></td> </tr> <tr> <td>Unitprice</td> <td><input size="50" maxlength="8" id="unitprice" /></td> </tr> </table> </form> </htmlform> </appml>

If you change the Category field in the form, the Categorydescription field will also change.
如果你改变了表单中的目录字段,目录描述字段也会改变。

View the output produced by the AppML HTML List Service
查看由AppML HTML 报告服务输出的结果

View the XML source file
查看XML 源文件

评论 (0) All

登陆 | 还没注册?