Skip to Content
0
Former Member
Aug 09, 2016 at 09:24 AM

Visible form with use formatter

34 Views

hi all,

my application have problem when i wanna give visible with formatter.

i use master and detail in my application.

in master have "listitem" have to press base on "subtype" and then the detail must to show simpleform/form base on subtype.

for example :

i have 2 or more field base on oData with different form. if i press with oData value (subty "1"), the result is true and oData (subty "2") is false.

then i press value "2", the result is true but value 1 is false

and other subtype like this process

let' see my code :

in view,

form 1

<f:SimpleForm visible="{path: 'Subty', formatter:'model.formatter.statusText'}"
/>

form 2

<f:SimpleForm visible="{path: 'Subty', formatter:'model.formatter.statusText1'}"
/>

in formatter

sap.ui.define([], function() {

"use strict";


return {

statusText: function (sStatus) {

if (sStatus==="1"){
return "true";}
if (sStatus==="2")
{return "false";}
else{
return "";
}
},
statusText1: function (sStatus) {
if (sStatus==="1"){
return "false";}
if (sStatus==="2")
{return "true";}
else{
return "";
}
},

in controller,

sap.ui.define([

"ztestdata/model/formatter"


Any hint, why my formatter isn't called?