View 如何在sapui5中将标签设置为必填项
最终视图应如下所示:View 如何在sapui5中将标签设置为必填项,view,label,sapui5,View,Label,Sapui5,最终视图应如下所示: <VBox height="90px"> <Label text="{i18n>FISCALYEAR_LABEL}" mandatory="mandatory"/> <Select id="FiscalYear" items="{ path: '/FiscalYearSet', sorter: { path: '
<VBox height="90px">
<Label text="{i18n>FISCALYEAR_LABEL}" mandatory="mandatory"/>
<Select id="FiscalYear"
items="{
path: '/FiscalYearSet',
sorter: { path: 'FiscalYearID' }
}">
<core:Item key="{FiscalYearID}" text="{FiscalYearNum}" />
</Select>
<ComboBox
items="{
path: '/FiscalYearSet',
sorter: { path: 'FiscalYearID' }
}">
<core:Item key="{FiscalYearID}" text="{FiscalYearNum}" />
</ComboBox>
</VBox>
view.xml中的代码如下所示:
<VBox height="90px">
<Label text="{i18n>FISCALYEAR_LABEL}" mandatory="mandatory"/>
<Select id="FiscalYear"
items="{
path: '/FiscalYearSet',
sorter: { path: 'FiscalYearID' }
}">
<core:Item key="{FiscalYearID}" text="{FiscalYearNum}" />
</Select>
<ComboBox
items="{
path: '/FiscalYearSet',
sorter: { path: 'FiscalYearID' }
}">
<core:Item key="{FiscalYearID}" text="{FiscalYearNum}" />
</ComboBox>
</VBox>
我设置了一个属性'mandatory=“mandatory”“,但它不起作用。
<Label text="{i18n>FISCALYEAR_LABEL}" required='true'/>
required
是sap.m.InputBase的属性之一,默认值boolean
设置为false
我知道如何修复。属性为'required=“true”'而不是'mandatory=“mandatory”'