Skip to Content
0

Creating Entities and update Entities whit a shitch.

Mar 07 at 10:31 PM

28

avatar image

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.

save1.png (4.1 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Jun Wu Mar 07 at 10:46 PM
1
state="{path:'ACTIVO', formatter:'.switchStatus'}"

when formatter is used, it becomes oneway binding. it will not receive data from UI
Show 2 Share
10 |10000 characters needed characters left characters exceeded

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.

0
Felipe Andahur
0