cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to map "Estimated Duration" value in overlay

vasantham
Explorer
0 Kudos

Hi Experts,

I have added Estimated Duration label in Transport Details overlay and need to show the corresponding value.

Component.js

jQuery.sap.declare("ztmui_extension.Component");

jQuery.sap.require("sap.tl_collaboration_portal.Component");

// new custom component

sap.tl_collaboration_portal.Component.extend("ztmui_extension.Component", {

            metadata: {

                customizing: {

                "sap.ui.controllerExtensions" : {

                "sap.tl_collaboration_portal.view.requestsForQuotation": {

                controllerName: "ztmui_extension.view.freightRequests"

                }

                }

                }

            },

            init : function() {

                this._oResourceModel = new

                sap.ui.model.resource.ResourceModel({

                        bundleName: "sap.tl_collaboration_portal.language_bundle.i18nGeneral"

                        });

                        this._oResourceModel.enhance({

                            bundleName: "ztmui_extension_language_bundle.custom"

                        });

                        sap.ui.core.UIComponent.prototype.init.apply(this, arguments);

                    },

                });

Controller.js

sap.ui.controller("ztmui_extension.view.freightRequests", {

  onInit: function() {

},

onAfterRendering: function() {

  if(sap.ui.getCore().byId("durationRow") == undefined){

  var oMatrixDurationRow =new sap.ui.commons.layout.MatrixLayoutRow({id : "durationRow"});

  var oMatrixDurationCell= new sap.ui.commons.layout.MatrixLayoutCell({

   id : "durationCell",

       content: new sap.ui.commons.Label({id : "durationLbl", text: "Estimated Duration :"})

       });

  oMatrixDurationRow.addCell(oMatrixDurationCell);

  sap.ui.getCore().byId("thingGroupTransport").mAggregations.content[0].addRow(oMatrixDurationRow);

  }

  else

  return;

  },

});

I am not able to get the selected row value from requestsTable inside onAfterRendering method.

Kindly let me know for any other solution.

Regards,

Vasantham

Accepted Solutions (1)

Accepted Solutions (1)

former_member189718
Active Participant
0 Kudos

Hi Vasantham,

I see two possibilities:

  1. If you want to stick with your taken approach: read the requestsTable (sap.ui.getCore().byId()) and from that instance you can read the selected row. This is explained in chapter 9.3 from the extension guide.
  2. My preferred option: Add a custom field extension like described in chapter 1. Then you can fill the value in the back end and it is automatically added in the UI.

Best regards,

Jan

vasantham
Explorer
0 Kudos

Hi Jan,

Thanks for your quick response.

     Option 1: I am able to read the table inside OnAfterRendering, not able to get the selected row. so i go for second option.

And i have one more query:

I need to add ETA field with Time and Date picker in the path : Freight order details overlay-> events tab-> Tour events -> add event-> add unexpected event popup.

Please let me know your preferred solution it would save the time.

Thanks,

Vasantham

former_member189718
Active Participant
0 Kudos

If you need a time and date picker, I assume the selected time has to be persisted in the back end afterwards?

This is not an easy thing, as the existing BAdI concept (chapter 1) doesn't support editable fields, only read only fields.

For writing back values from a custom extension, I would suggest to create an own additional Gateway service in which you can take care of persisting the timestamp at the designated place.

To call this service, you have to find an appropriate place on the UI to trigger that call.

Answers (0)