2017-11-29 6 views
0

Controller.jsここ、最初のテキストは、SAPにnullの場合UI5

table.bindItems({ 
    path: "/", 
    template: new sap.m.ColumnListItem({ 
     cells: [ 
      new sap.m.Text({ 
       text: "{account} ? {recieverAddress} " 
      }), 
     ] 
    }) 
}); 

"アカウント" がnullの場合、私は、 "recieverAddress" を示さなければなりません。 sap ui5でこれを行う方法。

+0

の可能性のある重複した[SAPUI5 - XML表現バインディング - 条件演算子でコードを続行](https://stackoverflow.com/質問/ 45096163/sapui5-xml-expression-binding-proceed-code-in-conditional-operator) – boghyon

答えて

3

あなたはバインディング式を使用できます。

text: "{= ${account} ? ${account} : ${recieverAddress} }" 
ここ

詳細:https://ui5.sap.com/#/topic/daf6852a04b44d118963968a1239d2c0

+1

+1 XMLバインディングの外部でもExpression Bindingが可能であることを知りませんでした。その場合、三項演算子を 'text $ {account} || $ {recieverAddress}}' '' – boghyon

+0

@boghyonああに置き換えることもできます。発現結合において我々は毎日学ぶ:D – Jorg

関連する問題