Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8944

Re: My XS project can not show the html result

$
0
0

Thanks, it did work, it need to change to /sap/ui5, but when I press F12, it have this error:

QQ截图20150531195014.png

 

QQ截图20150531195104.png

 

my view code:

sap.ui.jsview("xsui.XSUI", {

  getControllerName : function() {

  return "xsui.XSUI";

  },

  createContent : function(oController) {

  //header

  var oAppHeader = new sap.ui.commons.ApplicationHeader("appHeader");

  oAppHeader.setLogoText("SAPUI5 Overview Exercises");

  oAppHeader.setDisplayWelcome(false);

  oAppHeader.setDisplayLogoff(false);

 

 

  //menu

  var oMenubar = new sap.ui.commons.MenuBar;

  var oMenubarItem1 = new sap.ui.commons.MenuItem("menuitem-1",{text:"Menu-Item 1"});

  oMenubar.addItem(oMenubarItem1);

  var oMenubarItem2 = new sap.ui.commons.MenuItem("menuitem-2",{text:"Menu-Item-2"});

  oMenubar.addItem(oMenubarItem2);

 

  //add content

  var oPanel = new sap.ui.commons.Panel("panel",{text:"Enter Data"});

  var oLayout = new sap.ui.commons.layout.MatrixLayout();

 

  var oLabel1 = new sap.ui.commons.Label({text:"First Name"});

  var oTextField1 = new sap.ui.commons.TextField("Field1",{value:"{/firstName}"});

  var oTextView1 = new sap.ui.commons.TextView("textView1",{text:"{/firstName}"});

 

  var oLabel2 = new sap.ui.commons.Label({text:"Last Name"});

  var oTextField2 = new sap.ui.commons.TextField("Field2",{value:"{/lastName}"});

  var oTextView2 = new sap.ui.commons.TextView("textView2",{text:"{/lastName}"});

 

  var oButton = new sap.ui.commons.Button({

  text:"Submit",

  press:oController.update

  });

  //add rows

  oLayout.createRow(oLabel1).createRow(oTextField1,oTextView1);

  oLayout.createRow(oLabel2).createRow(oTextField2,oTextView2);

  oLayout.createRow(null,oButton);

  oPanel.addContent(oLayout);

 

  //total layout

  var oVerticalLayout = new sap.ui.layout.VerticalLayout({

  "content":[oAppHeader,oMenubar,oPanel]

  });

 

  return oVerticalLayout;

  }

 

 

});


Viewing all articles
Browse latest Browse all 8944

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>