Skip to Content
author's profile photo Former Member
Former Member

Problem in preview

HI Team,

Firstly, I'm new to UI5, Please kindly provide your suggestions even it is very silly mistake which i'm doing😊.

I've started with a sample which could be a similar requirement for my project.

Created "Product" SAP ui5 Project in SAP HANA studio.

Completed code in the View.js as shown below, But i'm not getting any button display in the Web App Preview.

_____________________________________________________________________________________________

sap.ui.jsview("product.Product", {

/** Specifies the Controller belonging to this View.

* In the case that it is not implemented, or that "null" is returned, this View does not have a Controller.

* @memberOf product.Product

*/

getControllerName : function() {

return "product.Product";

},

/** Is initially called once after the Controller has been instantiated. It is the place where the UI is constructed.

* Since the Controller is given to this method, its event handlers can be attached right away.

* @memberOf product.Product

*/

createContent : function(oController) {

var oMatrix = sap.ui.commons.layout.sap.ui.commons.layout.MatrixLayout({

layoutFixed: true,

width: '300px',

columns: 3

});

oMatrix.createRow(

new sap.ui.commons.Button({

text: "Create",

press: function() {

oController.create();

}

}),

new sap.ui.commons.Button({

text: "Edit",

press: function() {

oController.edit();

}

}),

new sap.ui.commons.Button({

text: "Delete",

press: function() {

oController.remove();

}

})

);

return oMatrix;

}

});

__________________________________________________________________________________________________

Kindly let me know, How can i troubleshoot the issue to get the output. Please Tell me if i miss something.

Thanks,

Prakash

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Jul 18, 2016 at 09:55 AM

    Hi Prakash,

    Check this statement:

    var oMatrix = sap.ui.commons.layout.sap.ui.commons.layout.MatrixLayout({
      layoutFixed: true,
      width: '300px',
      columns: 3
    });
    

    It should be

    var oMatrix = new sap.ui.commons.layout.MatrixLayout({
      layoutFixed: true,
      width: '300px',
      columns: 3
    });
    

    Regards,

    Sai.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 18, 2016 at 09:41 AM

    Open the URL in a browser and see if there is an error in the console.

    Also, share your index.html.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.