Skip to Content

Extending AR_SRVC_NEWS (Problem: extension works only on 2nd start of newsFeedList)

Hi everyone,

In the FIORI launchpad, after clicking a news tile I want the feeds to be displayed in a simple list with no links to the underlying feed. I therefore implemented an extension to the standard FIORI app AR_SRVC_NEWS where i changed the list mode of the "newsfeed"-element.

Extension code looks like this (NewsTileDrillDownCustom.controller.js):

onBeforeRendering: function() {
    var newsList = this.getView().byId("newsList");
    newsList.setMode(sap.m.ListMode.None); 

I then set a target mapping to the extension service in Launchpad Designer.

Target mapping looks like this:

semantic object: 'NewsFeed';
action: 'displayNewsList';
Type: 'Ui5-app';
URL: '/sap/bc/ui5_ui5/sap/zar_srvs_news/';
ID: 'WebContent.AR_SRVC_NEWSExtension'

My problem is, the extension works well, but only on the second click on the news tile. The first click after logging in to the launchpad triggers a call for the original AR_SRVC_NEWS (with the List being of mode "sap.m.ListMode.SingleSelectMaster"). Only after leaving the news feed and another click on the tile my extension ZAR_SRVC_NEWS service is called.

My extension code is placed in the 'onBeforeRendering' event handler. I´ve already tried putting it into "onInit" and "onAfterRendering" - No success.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on May 17, 2019 at 08:34 AM

    Just in case someone faces a similar question.

    I did not find a solution to make my extension work from the start. Instead I implemented a workaround.

    I just copied every file of the original AR_SRVC_NEWS app from the SAP repository to a new UI5 app and changed the view according to my needs. Then I made the target mapping point to my new service URL and component ID.

    Although I´d have prefered the extension as a leaner solution, clother to the SAP standard, this approach at least gets the job done.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 25, 2020 at 02:18 PM

    Hi Michael,

    I did not change that much if i remember correctly.

    Regarding the app, in the NewTileDrillDown.view.js we´ve changed the "oNewsItemTemplate" to a sap.m.FeedListItem.

    The target mapping in fiori designer then points to

    semObj: "NewsFeed"

    action: "displayNewsList"

    url: /sap/bc/ui5_ui5/sap/z_simplenewsf/ (with z_simplenewsf being the copied app´s name)

    id: WebContent

    rgds

    Jens

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Jens,

      i tried to do this, but when i only update the application name, there coming up two error's:

      1. When trying to deploy the adjusted app, there comes a prompt which tells me, that it's forbidden to override/delete sap textelements.

      ( --> I found out, that this has something to do with the properties-files for the tiles configuration, so I deleted them )

      2. After the deletion of the properties-files, I could deploy the app. As soon as I deployed the app, there came another prompt which was telling me, that there are now two applications with the same ID (the orginial and my copy of it). I just ignored that fact, but even though I adjusted the target mapping to my z-url, the original app has been called. Then I deactivated the original app in the sicf transaction but after that, the tile in the launchpad wasn't working at all anymore. Finally I gave up..

      How did you handle this?

      Best regards,

      Michael

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.