Skip to Content
Author's profile photo Former Member

Collaboration Portal: How to hide thingGroups or parts of thingGroups on overlays

Hi,

some of you may have already recognized that it is not possible to hide a thingGroup or row of a thingGroup on an overlay dialog using the sap.ui.viewModifications as described in the enhancement guide for the SAP TM collaboration portal. In order to hide a thingGroup or one of its rows, a new concept using sap.ui.ControllerExtensions has to be applied.

If you want to modify an overlay dialog, for instance the „Transport Details“ dialog for Freight Requests for Quotation, you need to identify the controller which refers to this overlay dialog, in this case the controller of view “sap.tl_collaboration_portal.view.requestsForQuotation”. Then you need to create a custom controller for exactly this view, which implements the following functions:

  • getThingGroupIdsToBeRemovedFromOverlay():
    Implement this, if you want to hide complete thingGroups on an overlay dialog, for instance group „Last Freight Quotation“ on overlay dialog „Transport Details“. Return an array with the technical IDs (string) of the thingGroup controls you want to hide.
  • getRowsToBeHiddenFromOverlay():
    Implement this, if you want to hide one or multiple rows of a thingGroup on an overlay dialog, for instance row „Dangerous Goods“ in group „Transport Details“ on overlay dialog „Transport Details“. Return an object of the following structure:

    { { thingGroupID      : “<thingGroupID1>”,

                 rowProperty        : “<PropertyOfRow1>” },

               { thingGroupID      : “<thingGroupID2>”,

                 rowProperty        : “<PropertyOfRow2>” }

             }

Within this object, property „thingGroupID“ must reflect the technical ID (string) of the thingGroup control, which contains the row, and property „rowProperty“ must contain the name (string) of the property, which is bound to this row, e.g. „DangerousGoodsIndicator“.

  • Enhance the custom Component.js as shown below:

jQuery.sap.declare(“zcoll_portal.Component”);

jQuery.sap.require(“sap.tl_collaboration_portal.Component”);

// new custom component

sap.tl_collaboration_portal.Component.extend(“zcoll_portal.Component”, {

  metadata : {

customizing : {

      “ sap.ui.controllerExtensions” : {

        “sap.tl_collaboration_portal.view.requestsForQuotation”: {

          controllerName: “zcoll_portal.CustomRequestsForQuotation”

        }

      }

    }

  }

});

  • Implement the custom controller Custom<xxx>.controller.js as shown below:

sap.ui.controller(“zcoll_portal.CustomRequestsForQuotation”, {

getThingGroupIdsToBeRemovedFromOverlay: function(){

      var aIdsToBeRemovedFromOverlay = new Array();

      // Hide Last Quotation Information

aIdsToBeRemovedFromOverlay.push(“thingGroupLastQuotation”);

      // Hide Business Partner Information

aIdsToBeRemovedFromOverlay.push(“thingGroupBusinessPartners”);

      return aIdsToBeRemovedFromOverlay;

  },

getRowsToBeHiddenFromOverlay: function(){

var oRowsToBeHidden  = {},

oNewElement1     = {},

oNewElement2     = {},

oNewElement3     = {};

      // Hide RFQ Status

oNewElement1.thingGroupID = “thingGroupRfq”;

oNewElement1.rowProperty = “LifecycleStatusDescription”;

      // Hide Contact Person Phone Number

oNewElement2.thingGroupID = “thingGroupRfq”;

oNewElement2.rowProperty = “ContactPersonPhoneNumber”;

      // Hide Dangerous Goods

oNewElement3.thingGroupID = “thingGroupTransport”;

oNewElement3.rowProperty = “DangerousGoodsIndicator”;

jQuery.extend(true, oRowsToBeHidden, [oNewElement1, oNewElement2, oNewElement3]);

      return oRowsToBeHidden;

  }

});


And that’s it! This is introduced with SAP Note 2354736 – Collaboration Portal: It is not possible to hide thingGroup or thingGroup row on an overlay, and the Enhancement Guide for the SAP TM collaboration portal will also be updated with this new concept very soon. Stay tuned!


Cheers,

Sabine

Assigned Tags

      11 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Vasantham S
      Vasantham S

      Hi Sabine,

      Thanks for helpful blog.

      Can we hide an item from ThingInspector with same approach?

      Ex: Cargo tab in Freight Order details screen.

      Thanks,

      Vasantham

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Hi Vasantham,

      unfortunately, this specific new concept only allows to hide thingGrups or rows in thingGroups. As a workaround, you can however try to use the introduced functions in the controller to hide the item yourself...I did not try that, but I think it would be wort a try if you need to hide the item.

      Best regards,
      Sabine

      Author's profile photo Vasantham S
      Vasantham S

      Hi Sabine,

      Sure. We need technical ID to hide the field. But NavigationItem (Cargo) dont have technical ID.

      Do you have any other approach to try.

      Thanks in advance.

      Regards,

      vasantham

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Hi Vasantham,

      no, unfortunately not. If you have a use case where you need this, please open an SAP incident and we will analyze it.

      With kind regards,
      Sabine

      Author's profile photo Vasantham S
      Vasantham S

      Thanks for the info Sabine.

      We will raise an SAP incident.

      Regards,

      Vasantham

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      This is now also possible with SAP Note 2356481 - Collaboration Portal: It is not possible to hide navigationItem or panel on an overlay. The Enhancement Guide for SAP TM collaboration portal has been updated with the respective instructions.

      Cheers,
      Sabine

      Author's profile photo Vasantham S
      Vasantham S

      Hi Sabine,

      Can we have hide / add fields in expandable details screen in detail view with the same approach?

      PFA.

      Thanks,

      Vasantham

      Capture1.PNG

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Hi Vasantham,

      no, this is unfortunately not possible.

      With kind regards,
      Sabine

      Author's profile photo Vasantham S
      Vasantham S

      Thanks Sabine.

      Is it possible with any other extension methods?

      I could see the screen is built using HTML code. How can we resolve it.

      Thanks

      Vasantham

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Hi Vasantham,

      I am sorry, but there is no support available for hiding parts of the detail screen. This would be a new requirement, which I can take with me, but this is nothing which we can provide a SAP Note for. Thanks for understanding.

      With ind regards,
      Sabine

      Author's profile photo Pawan Thareja
      Pawan Thareja

      Hello Everyone,

      I was going through the blog and i had a similar requirement but in my scenario we are required to add field to the overlay dialog and a custom table to print the gross amount split as shown in the below screen shot?

       

      Wanted to know if it can be achieved and what are the steeps required to enhance the UI in such cases.

       

      Thanks in advance.

      Pawan