cancel
Showing results for 
Search instead for 
Did you mean: 

Creating Entities and update Entities whit a shitch.

0 Kudos

Hi experts, I need your help please.

I created an app whit CRUD Master-Detail template.

When I create a entry only fields Input add object in property mChangedEntities but when the input replacement by switch dont add nothing.

This is my form in CreateEntity.view.xml

<Label text="Código" required="true"/>
<Input name="CODRECH" id="CODRECH_id" enabled="{= ${viewModel>/mode} === 'edit'? false: true}" value="{ path: 'CODRECH', type: 'sap.ui.model.odata.type.String' , constraints:{ maxLength:2, nullable:false } }"/>
<Label text="Descripción" required="false"/>
<Input name="DESCRIPCION" value="{ path: 'DESCRIPCION'}"/>
<Label text="Activo"/>
<Switch name="ACTIVO" id="activo" state="{path:'ACTIVO', formatter:'.switchStatus'}" />

How i can add value a property 'ACTIVO'. When create an update one entry ?

Please! Thanks.

Accepted Solutions (0)

Answers (1)

Answers (1)

junwu
Active Contributor
state="{path:'ACTIVO', formatter:'.switchStatus'}"

when formatter is used, it becomes oneway binding. it will not receive data from UI
0 Kudos

Hi jun.

Thanks for your answer.

I have a litle problem when edit. Becouse 'ACTIVO' is INT not BOOL (1=true; 0=false), for that it formatter.

How I can change property ACTIVO before rendering view ? State expected boolean not int.

junwu
Active Contributor
0 Kudos