2017-01-27 7 views
-1

NotificationnListItemと同様のFeedListItemに2つのボタンを追加したいと思います。FeedListItemにButtonを追加する方法

<List headerText="Feed Entries" items="{ path : '/userFeedBack', mode : 'OneWay' }"> 
    <FeedListItem sender="@{UserScreenname} ({UserName})" 
     icon="{ProfileImgUrl}" senderPress=".navToUser" 
     iconPress=".navToUser" 
     iconDensityAware="false" info="{Type}" 
     timestamp="{ path : 'Time', formatter : '.notificationListItemFormatted' }" 
     text="{TweetText} ({Total} times)"> 
    </FeedListItem> 
</List> 

List view

それは次のようになります。どのようにこれらのボタンを使うことができますか、ここで使用できる他のリストコントロールがありますか?

答えて

0

ボタンの場合、異なるタイプのリスト項目を使用する必要があります。 FeedListItemは集約をサポートしていません。 sap.m.CustomListItem

  • sap.m.NotificationListItem
    1. :テキストとボタンが意志ここで、あなたは、イメージが来るのレイアウトを作成する必要があります私は、次のオプションをお勧めしますレンダリングする。
    2. FeedListItemを拡張してカスタムコントロールを作成し、「ボタン」集約を追加します。

    入力がさらに必要な場合は教えてください。

    +0

    第三のオプションが良いようです。どのように私のコントロールを拡張し、ボタンの集計を追加することができます。それに関する助け –

    0

    XMLコード:

    <List id="notificationList" class="sapContrast sapContrastPlus"> 
           <NotificationListItem 
             description="Information of List Item 1" 
             showCloseButton="false" 
             datetime="1 hour" 
             unread="true" 
             press="onListItemPress" 
             authorName="Jean Doe" 
             authorPicture="sap-icon://globe"> 
            <buttons> 
             <Button text="Accept" type="Accept" ></Button> 
             <Button text="Reject" type="Reject" class="sapUiLargeMarginEnd" ></Button> 
             <Button icon="sap-icon://thumb-up" class="sapUiLargeMarginBegin" ></Button> 
            </buttons> 
           </NotificationListItem> 
           <NotificationListItem 
             description="Information of List Item 2" 
             showCloseButton="false" 
             datetime="1 hour" 
             unread="true" 
             priority="None" 
             authorName="Jean Doe" 
             authorPicture="sap-icon://world"> 
            <buttons> 
             <Button text="Accept" type="Accept" ></Button> 
             <Button text="Reject" type="Reject" class="sapUiLargeMarginEnd" ></Button> 
             <Button icon="sap-icon://thumb-down" class="sapUiLargeMarginBegin" ></Button> 
            </buttons> 
           </NotificationListItem> 
          </List> 
    
    関連する問題