2016-11-14 2 views
1

のデータでタイルを監視現在、Web-IDEをテストしていて、HCPのデータで自動的に更新されるタイルを持つ小さなアプリケーションを作成しようとしています。HCP(js)

TileContainerはこれを作成するための正しい機能ですか?私はどのタイルを使用しなければならないか分かりません。

データをタイルのコンテンツにどのように供給しますか?

var tileContainer = new sap.m.TileContainer({ 
tiles : [ 
new sap.m.StandardTile({ 
number: "C_SENSORTEMP", 
height: "50px", 
icon : "sap-icon://play", 
title : "Temparature", 
frameType: "TwoByOne", 
press : function() { 
oController._eventHandler("start"); 
app.to("page2"); 
}) 
] 
}); 

答えて

1

はいタイルは正しいです。ここで小さな例です:

<GenericTile class="sapUiTinyMarginBegin sapUiTinyMarginTop tileLayout" header="Cumulative Totals" subheader="Expenses" frameType="OneByOne" 
    press="press"> 
    <tileContent> 
     <TileContent unit="Unit" footer="Footer Text"> 
      <content> 
       <NumericContent value="12"/> 
      </content> 
     </TileContent> 
    </tileContent> 
</GenericTile> 

enter image description here

あなたはデータをバインドしたいときは、xmlファイルでそれを行うことができますあなたがODATAサービスをバインドする必要が

<NumericContent value="{ForExampleExpenses}"/> 

とコントローラに:として

this.getView().bindElement(/getExpenses); 

あなたはより多くの例hereを見つけることができます。

+0

ok.t​​hanksたとえば、openweatherのcitytemperatureのバインディングは、view.jsのように見えますか?ソース:http://api.openweathermap.org/data/2.5/weather?q=London&mode=json – andreasm

+0

送信したリンクが私のために機能しません(401認可が必要です)。しかし、その側のJSONの例((http://openweathermap.org/current)のAPIの天気のパラメータの応答、JSON、APIの応答の例): "main":{"temp":293.25、...これを試すことができます:、xml.view – Jaro

関連する問題