ofbiz 表单控件之display标签

来源:互联网 发布:淘宝助理设置橱窗推荐 编辑:程序博客网 时间:2024/06/07 04:46

标签控件display

拥有的属性

also-hidden description size type currency image-location default-value

also-hidden:枚举类型(取值范围 true , false),默认值为true。如果该属性设置为true,则对应的表单下会自动创建一个与该控件对应的隐藏的input。
例子:
<field name="name" title="${uiLabelMap.BookingName}"  sort-field="true"><display/></field>
如上面的field标签的定义,会再form表单下创建下面的input:
<input type="hidden" name="name" value="${name}" id="formName_name">
如果只想显示值,不希望表单提交时包含隐藏的input,则需要将also-hidden="false".如:
<field name="name" title="${uiLabelMap.BookingName}"  sort-field="true"><display also-hidden="false"/></field>

description:字符串类型,控件上展示给用户的内容。可以使用${}表达式构造内容。如果字段值为空,则会显示默认值,默认值有default-value属性定义。

size:整数类型,指定字段的大小(单位为字符数,中文和英文都算一个1符),当要显示的文本超出给定大小时,将截断并添加完整文本作为提示(即继续输入也无效了)。

type:枚举类型(取值范围:text currency date date-time image accounting-number),默认值是text。显示内容的格式,默认为直接显示文本字符串。currency表示货币格式,date只显示日期,date-time显示日期+hours:minutes 

currency:字符串类型,指定用于格式语境价值的货币计量单位的身份,一般应使用$ {}语法来检索值。

image-location:字符串类型,显示指定路径下的图片。

default-value:字符串类型,字段值为空时,默认显示该值。

可能包含的子标签

in-place-editor:通过定义该标签,可以实现表格内编辑数据。

例子(specialpurpose\example\widget\example\ExampleForms.xml):
<field name="exampleName" title="${uiLabelMap.CommonName}" id-name="exampleName">            <display>                <in-place-editor url="/example/control/updateExample" cancel-control="button" saving-text="Updating..." text-between-controls=" ">                    <simple-editor/>                    <field-map field-name="exampleId" from-field="exampleId"/>                    <field-map field-name="statusId"  from-field="statusId"/>                </in-place-editor>            </display>        </field>










原创粉丝点击