2016-02-25 154 views
0
<Label required="true" text="Vorname"/> 
<Input enabled="true" fieldGroupIds="Patient" id="Vorname" liveChange="_validateSaveEnablement" name="Vorname" valueLiveUpdate="true" 
    value="{ 
      path : 'Vorname', 
      type : 'sap.ui.model.odata.type.String' , 
      constraints : { 
       minLength : 2, 
       maxLength : 29 
      } 
    }"/> 

看来minLength将无法​​正常工作。该字段是必需的,但仍然接受空值。我做错了什么?检查用户输入:minLength

回答

1

您使用的类型sap.ui.model.odata.type.String实际上不支持minLength(可能是因为OData不支持它)。

您可以将您的类型切换到sap.ui.model.type.String以使其工作。

请参阅以下示例:plnkr.co (credit to Qualiture for the base template)

第一个输入字段同时支持minLengthmaxLength,第二个仅支持maxLength

+0

...谢谢。它现在有效。 – corax228