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