Skip to Content
1
Jun 23, 2017 at 11:32 AM

Binding to an Entity Type

827 Views

Hello,

I'm using a SmartForm with SmartFields, and I need to bind it to and entity so my fields get the types / texts from the metadata of the entity. The problem is that I dont want to use the Form to display or to update an existing value (Get_Entity request) insteed I want to create a new request.

If I use BindElement, I must specify a value Ex. oForm.bindElement("/Product("XXXX")")

But also I must put the model of type TwoWay, so the Form can check my fields, if them are correct. But if i bind him on this way, I will always create an UpdateRequest.

I want to bind him, without specifing nothing, and not creating any request, so at the end i could create them myself.

I tryd with

oForm.setBindingContext(new sap.ui.model.Context(oView.getModel(), "/ProductSet"))

But when I put it oView.getModel().setDefaultBindingMode("TwoWay");

When I modify my input field and set a text it auto deletes..

I saw a property of the SmartForm "entityType" but seems it dosn't do nothing...

So how can I solve this problem?