2016-12-14 61 views
0

スマートテーブルでODataサービスを呼び出そうとしています。最初に私は単純なテーブルを作成し、それを使ってテーブル内のデータを見ることができます。それから、SmartTableを同じページに追加しましたが、データが表示されません。列が作成されていない場合でも。理由は何でしょうか?スマートテーブルにデータがありません

<mvc:View controllerName="com.siemens.hc.controller.View1" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:mvc="sap.ui.core.mvc" 
    xmlns="sap.m" xmlns:smartField="sap.ui.comp.smartfield" xmlns:smartFilterBar="sap.ui.comp.smartfilterbar" 
    xmlns:smartTable="sap.ui.comp.smarttable"> 
    <App> 
     <pages> 
      <Page title="{i18n>title}"> 
       <content>     
         <Table id="idProductsTable" inset="false" items="{/SafetyUpdateSet}"> 
          <headerToolbar> 
           <Toolbar> 
            <Title text="Product" level="H2"/> 
           </Toolbar> 
          </headerToolbar> 
          <columns> 
           <Column width="12em"> 
            <Text text="Product"/> 
           </Column> 
          </columns> 
          <items> 
           <ColumnListItem> 
            <cells> 
             <ObjectIdentifier title="{Notification}"/> 
            </cells> 
           </ColumnListItem> 
          </items> 
         </Table> 

        <smartTable:SmartTable id="smartTable_ResponsiveTable" tableType="ResponsiveTable" editable="false" entitySet="SafetyUpdateSet" 
         useVariantManagement="false" useTablePersonalisation="false" header="Notification" showRowCount="true" useExportToExcel="false" 
         enableAutoBinding="true">       
        </smartTable:SmartTable> 
       </content> 
      </Page> 
     </pages> 
    </App> 
</mvc:View> 

私はneo-app.jsonファイルで宛先を作成し、Manifest.jsonファイルにモデルを作成しました。

よろしく、 Mayank

答えて

0

あなたは "請求書" という名前のモデルを持っています。 documentationによれば、名前付きモデルはスマートコントロールではサポートされていません。

+0

こんにちは、私はすでにそれを削除しました。スレッドを掲示した後、私は見た。しかし、まだそれは動作していません。 –

+0

@Mayank:ログにエラーがありますか?名前付きモデルが機能しないことが判明した後に、質問を更新すると便利です。 – matbtt

+0

こんにちはマット、返事をありがとう。ログにエラーはありません。 lineItemに注釈タグがないことを確認しているときに、私はOdataサービスにもう1つ追加したいと思います。それは義務だと思いますか? –

0

My SmartTableで手動で列を定義する必要がありました。

<smartTable:SmartTable id="smartTable_ResponsiveTable" tableType="ResponsiveTable" editable="false" entitySet="EntitySet" 
        useVariantManagement="false" useTablePersonalisation="false" header="Notification" showRowCount="true" useExportToExcel="false" 
        enableAutoBinding="true" initiallyVisibleFields="Col1,Col2,Col3,Col4,Col5"></smartTable:SmartTable> 
0

oDataサービスが注釈をサポートしている場合は、注釈ファイルを使用することもできます。新しい注釈ファイルを作成し、エンティティセットに注釈を付け、LineItem/DataField注釈を追加します。選択したフィールドが表示されます。

  <Annotations Target="<oData.Service>"> 
      <Annotation Term="UI.LineItem"> 
       <Collection> 
        <Record Type="UI.DataField"> 
         <PropertyValue Property="Value" Path="Field1"/> 
         <PropertyValue Property="Label" String="{i18n>Field1Label}"/> 
        </Record> 
        <Record Type="UI.DataField"> 
         <PropertyValue Property="Value" Path="Field2"/> 
         <PropertyValue Property="Label" String="{i18n>Field2Label}"/> 
        </Record> 
        <Record Type="UI.DataField"> 
         <PropertyValue Property="Value" Path="Field3"/> 
         <PropertyValue Property="Label" String="{i18n>Field3Label}"/> 
        </Record> 
       </Collection> 
      </Annotation> 
     </Annotations> 

oDataフィールド名が好きな場合は、 'label'プロパティを省略することができます。

0

私はこのエラーに直面しました。

これは図の上部に

xmlns:app="http://schemas.sap.com/sapui5/extension/sap.ui.core.CustomData/1" 

を追加することで解決することができます。これを追加する理由/説明は見つかりませんでしたが、FlexItemDataに関連していると思います。

関連する問題