2015-04-27 52 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