on 09-13-2016 4:11 PM
Hi Experts,
I have a table in my XML view with mode as singleselectleft as below
When the customer selects one of the row and clicks on "Create Ticket" button a popup opens like
I want to display data in these fields from odata.
The code I tried for displaying the data
createticket: function(oEvent) {
// create popover
if (!this._oPopover1) {
this._oPopover1 = sap.ui.xmlfragment("popoverNavCon", "CustomerPortal.Popover", this);
this.getView().addDependent(this._oPopover1);
}
// delay because addDependent will do a async rerendering and the popover will immediately close without it
var oButton = oEvent.getSource();
jQuery.sap.delayedCall(0, this, function() {
this._oPopover1.openBy(oButton);
});
},
Once these details are displayed I have to create a new ticket for the same. Please provide suggestions on how this can be accomplished.
Regards,
Srinivasan
Hi Srinivasan,
Just call the service and bind the data to fragment.
Will this rough sample help, I was using JSON model though: Punker
Working Snippet:
Regards,
Sai.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sai,
Thank you for your sample code. I implemented your code. Still I get empty popup. One difference I found that you have set the oModel in the onInit() whereas I have done it like
_routePatternMatched: function(oEvent) {
var sId = oEvent.getParameter("arguments").ID,
oView = this.getView(),
sPath = "/ServiceRequestCollection('" + sId + "')";
var oModel = new sap.ui.model.odata.ODataModel("/sap/c4c/odata/v1/c4codata/");
oModel.read("/ServiceRequestCollection?$filter=CustomerID eq '1001192'", {
success: function(oData, response) {
var oResult = [];
oResult = oData.results;
ibasearray = oResult;
ibasearray = {
service: ibasearray
};
var oVizFrame3Model = new sap.ui.model.json.JSONModel(ibasearray);
var oTable = oView.byId("idibaseTable");
oTable.setModel(oVizFrame3Model);
var oBinding = oTable.getBinding("items"),
oFilter;
oFilter = new Filter("ProductID", "EQ", ibasetable);
oBinding.filter([oFilter]);
}
});
oView.bindElement({
path: sPath,
events: {
dataRequested: function() {
oView.setBusy(true);
},
dataReceived: function() {
oView.setBusy(false);
}
}
});
},
Hope this is not the reason my popup appears empty. Please provide your suggestions
Regards,
Srinivasan
Hi Srini,
Hoping you get all the data (fields in create ticket ) when you attach the data to the table .. if yes than you need to just get the binding context and attach it to the dialog ,
thanks
Viplove
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.