Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sapui5 如何将按钮添加到FeedListItem_Sapui5 - Fatal编程技术网

Sapui5 如何将按钮添加到FeedListItem

Sapui5 如何将按钮添加到FeedListItem,sapui5,Sapui5,我想向FeedListItem添加两个按钮,类似于NotificationnListItem <List headerText="Feed Entries" items="{ path : '/userFeedBack', mode : 'OneWay' }"> <FeedListItem sender="@{UserScreenname} ({UserName})" icon="{ProfileImgUrl}" senderPress=".navToU

我想向FeedListItem添加两个按钮,类似于NotificationnListItem

<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>


应该是这样的。如何使用这些按钮,或者是否有其他列表控件可以在此处使用?

对于按钮,您必须使用不同类型的列表项。FeedListItem不支持任何聚合。我建议以下几种选择:

  • sap.m.NotificationListItem
  • sap.m.CustomListItem:在这里,您需要创建一个布局,图像将出现在哪里,文本和按钮将呈现在哪里
  • 通过扩展FeedListItem并向其添加“按钮”聚合来创建自定义控件
  • 如果需要更多输入,请告诉我。

    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>
    

    第三个选项似乎不错。但我如何扩展我的控件并向其中添加button的聚合。有什么帮助吗