2017-10-09 5 views
0

私のプロジェクトでi18nファイルを使用しています。私はプロパティ "missingItems"のプレースホルダに入るテキストを太字にする必要があります。これは、国際化からプロパティです:SAPUI5の太字のプレースホルダテキスト

missingItems = The items: {0} are missing! 

コントローラ:

var missingItemsArray= ["item1", "item2", "item3"] 
var sMessage = this.getView().getModel("i18n").getResourceBundle().getText("missingItems", [missingItemsArray]); 
      MessageBox.show(sMessage, { 
       icon: MessageBox.Icon.WARNING, 
       title: "exampleTitle", 
       actions: [sap.m.MessageBox.Action.OK], 
       id: "messageBoxId2", 
       defaultAction: sap.m.MessageBox.Action.OK, 
       details: "exampleDetails" 
      }); 

すべてのヘルプは高く評価されます! :)

答えて

1

にこれを追加します。

国際化

missingItems = The items: <strong>{0}</strong> are missing! 

コントローラ

var missingItemsArray= ["item1", "item2", "item3"]; 
var sMessage = this.getView().getModel("i18n").getResourceBundle().getText("missingItems", [missingItemsArray]); 
var formattedText = new sap.m.FormattedText("FormattedText", { 
    htmlText: sMessage 
}); 
MessageBox.show(formattedText, { 
    icon: MessageBox.Icon.WARNING, 
    title: "exampleTitle", 
    actions: [sap.m.MessageBox.Action.OK], 
    id: "messageBoxId2", 
    defaultAction: sap.m.MessageBox.Action.OK, 
    details: "exampleDetails" 
}); 

例:https://sapui5.hana.ondemand.com/#/sample/sap.m.sample.FormattedText/code/C.controller.js

+0

ありがとうPablo !!! –

0
font-weight: bold 

あなたはこのようFormattedTextコンポーネントを使うべき大胆なプレースホルダーテキスト

+0

どこに配置する必要がありますか? –

+0

あなたはあなたのCSSまたはjavacriptでこれを行うことができます – kappo

+0

しかし、それは全体のテキストを変更するつもりです。私はそれの{0}部分のみ太字にしたい。 –