2015-04-27 49 views
-2

最终的观点应该是这样的:如何sapui5标签前插入字符 “*”

enter image description here

在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'',但它不起作用。

+0

我已经知道如何解决默认boolean值。该属性是'必需=“真”“不”强制性=“强制性”' – huangxbd1990

回答

2
<Label text="{i18n>FISCALYEAR_LABEL}" required='true'/> 

required属性之一sap.m.InputBase设置为false