cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 Smart Table - Smart Field make field mandatory with annotation

dusa
Explorer
0 Kudos

Is it possible to make a Property in SAPUI5 Smart Table mandatory so that a user can't leave a field empty while editing it?

I found out that sap:field-control should contain number a path expression to another property which contains the number. However this doesn't work:

<Property Name="NameLast" Type="Edm.String" Nullable="false" MaxLength="40" sap:label="Last name" sap:field-control="Name_fc" />
<Property Name="Name_fc" Type="Edm.Byte" />

Value of Name_fc property is '7'. I don't see any console error now, however I can still leave the input (NameLast) field empty without any validation and send it to OData service, which is not what I expect.

Here is a link to an example from sap where they use required fields. I have no idea though how they made it:https://sapui5.netweaver.ondemand.com/sdk/explored.html#/sample/sap.ui.comp.sample.smartfield/previe...

The field Name is required, but I don't see any "required" settings in metadata.xml nor in the View.

Another example with required Fields is here, but also here it is not obvisous for me how was it done:https://sapui5.netweaver.ondemand.com/sdk/explored.html#/sample/sap.ui.comp.tutorial.smartControls.0...

Accepted Solutions (0)

Answers (0)