我有一个vertical layout
,其中input fields
可能<Input/>, <DatePicker/>, <Checkbox/>
,<DateTimePicker/>
和value
。当我将Input, DateTimePicker or DatePicker
的{{1}}绑定到"{thingDetail>value}"
时,它就像应该的那样工作。当我尝试将selected
中的checkbox
部分绑定到"{thingDetail>value}"
时,始终会检查checkbox
,即使我的JSONModel
表示值为{{1} }}
"false"
当我记录它时,这是我的 <layout:VerticalLayout
width="100%"
visible="{= ! ${path: 'thingDetail>properties'}}">
<Input
id="masterDataValueInput"
value="{thingDetail>value}"
placeholder="{path:'thingDetail>type', formatter:'.formatter.placeHolderFormatter'}"
visible="{= ${path: 'thingDetail>type', formatter: '.formatter.inputVisibility'}}"
enabled="{appView>/isCurrentTenant}"
width="100%"
type="{path:'thingDetail>type', formatter:'.formatter.inputTypeFormatter'}"/>
<DatePicker
id="masterDataValueDate"
value="{thingDetail>value}"
visible="{= ${path: 'thingDetail>type', formatter: '.formatter.dateVisibility'}}"
enabled="{appView>/isCurrentTenant}"
width="100%"/>
<DateTimePicker
id="masterDataValueDateTime"
value="{thingDetail>value}"
visible="{= ${path: 'thingDetail>type', formatter: '.formatter.datetimeVisibility'}}"
enabled="{appView>/isCurrentTenant}"
width="100%"/>
<CheckBox
id="masterDataValueCheckbox"
selected="{thingDetail>value}"
visible="{= ${path: 'thingDetail>type', formatter: '.formatter.checkboxVisibility'}}"
enabled="{appView>/isCurrentTenant}"/>
</layout:VerticalLayout>
。
答案 0 :(得分:0)
TwoWayDataBinding
无法实现Nervermind .. formatter
。错误是data type
。
使用以下代码:
<CheckBox
id="masterDataValueCheckbox"
selected="{path: 'thingDetail>value', type: 'sap.ui.model.type.String'}"
visible="{= ${path: 'thingDetail>type', formatter: '.formatter.checkboxVisibility'}}"
enabled="{appView>/isCurrentTenant}"/>