Skip to Content
avatar image
Former Member

I want to create a dialog box on press of a button in controller and bind the data.

basically a table have a view button on click of it , it should fetch the event id of the row and display the title and description from backed system .

i have written the flowing code in the controller part on the press function of the view button but i am not able to fetch any data please help.

onView: function(oEvent) {

//identifing the selected rows event id

var otable = this.byId("idTableNotifiation");

var path = oEvent.getSource().getParent() .getBindingContext().getPath();

var selectedRow = otable.getModel().getProperty(path);

var oEventID = selectedRow.EventID;

// contents of the dialog box

var oLabelTitle = new sap.m.Label({ text: "{TitleStory}",

design: "Bold", }).addStyleClass("title");

var oFlexboxTitle = new sap.m.FlexBox({ height:"40px", alignItems:"Start", justifyContent:"Center", alignContent: "Stretch" , items: [oLabelTitle]});

var oLabelDescription = new sap.m.Text({ text: "DESCRIPTION:", design: "Bold", });

var oTextDescription = new sap.m.Label({ text: "{NContent}", });

var oVboxContent = new sap.m.VBox({ items: [ oLabelDescription,oTextDescription] });

var oBtnBack = new sap.m.Button({ text : "Close", icon : "sap-icon://back", press : function(){ oDialog1.close(); oDialog1.destroy(); } })

var oVboxCreateLayout = new sap.m.VBox({ width:"100%", items: [oFlexboxTitle,oVboxContent] });

var oDialog1 = new sap.m.Dialog({ title: "View Notification",

//content : [oVerticalLayou]


oDialog1.bindElement("/NotificationCollection('" + oEventID + "')"); oDialog1.addContent(oVboxCreateLayout) oDialog1.addButton(oBtnBack);; },

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers