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

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

APPML 中的 AppML HTML 表单


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

The <htmlform> element contains the elements of an HTML form.
<htmlform>元素嵌套了HTML表单元素。


The <htmlform> Element
<html>元素

By adding an <htmlform /> element after the <database> element, the AppML Form Service will generate an HTML input form based on the SQL defined in the <database> element. An empty record will be displayed, ready to be filled with data. New/Submit/Delete buttons will automatically be added.
通过在<database>元素之后添加一个<htmlform />元素,该AppML报告服务将产生一个基于定义在<database>元素中SQL的HTML报告;将显示一个空记录,可以在其中书写数据; “New [新添] / Submit [提交] / Delete [删除] ”按钮将会自动被添加进去。

Note: When working with HTML lists and forms, the <keyfield> and <maintable> elements must be presented in the <database> element:
注意:当与HTML列表和表单一起运行时,<keyfield> 和 <maintable>元素必须存在于<database>元素:

<?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>
<htmlform />
</appml>

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

View the XML source file
查看XML 源文件

However, when working with data, it is more probable that the user wants to see the data in a list and have the opportunity to modify existing data and add new data to the database. Therefore we add the <htmllist> element. The user will now view the data in a list, but a folder image is added to the left of each record. An input form will open when clicking on the folder image. The user may now modify the data or enter new records (by clicking on the new button in the list OR in the input form):
然而,当伴随数据运行时,大多数用户都希望看到列表中的数据,并且,他们都希望修改现存的数据,并向数据库中添加新数据。因此,我们添加<htmllist>元素。用户将在列表中查看数据,文件夹图像将被放置到每条记录的左边。当点击文件夹图像时,将会打开一个输入表单。用户将可以修改当前数据或输入新的记录(通过点击输入表单中列表的“新添”按钮):

<?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 />
</appml>

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

View the XML source file
查看XML 源文件

To create more advanced HTML forms, look at the examples in the attributes and child elements below.
创建更多高级的HTML表单,见下面的属性案例和子元素列表中的案例。


<htmlform> Attributes
<htmlform>属性

The <htmlform> element may have the following attributes:
<htmlform>元素可以包含下面的属性:

Attribute
属性
Value
Description
描述
delete false Disables the "Delete" button in the HTML input form
取消使用HTML输入表单中的“Delete [删除]”按钮
name formname Specifies a unique name for the input form. This enables the AppML Form Service to run a number of different input forms from the same AppML description
为输入表单指定一个独立的名称。这可以使得AppML表单服务运行一组来自于相同AppML描述的不同的输入表单
new false Disables the "New" button in the HTML input form
取消使用HTML输入表单中的“New [新添]”按钮
submit false Disables the "Submit" button in the HTML input form
取消使用HTML输入表单中的“Submit [提交]”按钮
target URL  


<htmlform> Child Elements
<htmlform>子元素

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

Element
元素
Description
描述
elements A container for the data fields in an HTML form that should fulfill special criterions
在一个可编辑的HTML表单中指定数据字段的容器,它符合指定的标准以及条件
footer Defines a footer that will be displayed after the HTML form on the page
定义一个显示在HTML表单页面之后的页脚
form Provides a way to define your own input form. All legal HTML elements are allowed
提供一个定义输入表单的方式。允许使用所有合法的HTML元素
header Defines a header that will be displayed before the HTML form on the page
定义一个显示在HTML表单页面之前的页眉
onload Defines a script to be executed when the HTML form loads
定义在下载表单时所执行的脚本程序
script A container for scripts that can be executed from everywhere inside the HTML form
指定在HTML表单中用于在任何地方执行的脚本容器
stylesheet Defines a stylesheet for the HTML form
为HTML表单定义一个样式表
sql Defines an SQL statement for the HTML form
为HTML表单定义一个SQL语句
title Defines a title for the HTML form
为HTML 表单定义一个标题


评论 (0) All

登陆 | 还没注册?