bigDecimalField 大数字段
bigDecimalField 与 textField 功能相似,但仅允许输入 BigDecimal 类型。
XML 元素 |
|
|---|---|
Java 类 |
|
基本用法
bigDecimalField 的基本示例:
<bigDecimalField id="bigDecimalField" label="BigDecimalField" width="15em"/>
数据感知的 bigDecimalField
该组件支持绑定至 data container 中的实体属性。
如需将 bigDecimalField 绑定至实体属性:
-
使用 dataContainer 属性指定数据容器的名称。
-
使用 property 属性指定实体属性的名称。
实体属性必须为 BigDecimal 类型。
<data>
<instance id="productDc"
class="io.jmix.uisamples.entity.Product"
fetchPlan="_local"/>
</data>
<layout>
<bigDecimalField id="bigDecimalField" label="Field connected to a container" width="15em"
dataContainer="productDc" property="price"/>
<hbox>
<span text="Value in the container:"/>
<span id="spanValue"/>
</hbox>
</layout>
样式版本
使用 themeNames 属性配置一个或多个样式。
| 样式 | 描述 | 支持的主题 |
|---|---|---|
|
组件尺寸较小 |
Aura, Lumo |
|
字段值左对齐 |
Aura, Lumo |
|
字段值居中 |
Aura, Lumo |
|
字段值右对齐 |
Aura, Lumo |
|
帮助文字显示在字段上方,标题下方。 |
Aura, Lumo |
XML 属性
下面是 bigDecimalField 的特殊属性:
| 名称 | 描述 | 默认值 |
|---|---|---|
当组件获得焦点时,是否自动选中文本内容。 |
— |
|
控制是否显示一个清除内容的按钮。 |
|
|
设置组件值。 |
— |
下面是 bigDecimalField 支持的其他通用属性:
id - alignSelf - ariaLabel - ariaLabelledBy - autocapitalize - autocomplete - autocorrect - autofocus - classNames - colspan - css - dataContainer - enabled - errorMessage - focusShortcut - height - helperText - label - maxHeight - maxWidth - minHeight - minWidth - placeholder - property - readOnly - required - requiredMessage - tabIndex - themeNames - title - valueChangeMode - valueChangeTimeout - visible - width