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”'