cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 page not loading the content

Former Member
0 Kudos

Hi,

I am new to SAPUI5. I created a small html page with two text fields and a submit button.

When i tried to access this page i  am getting the error 'Object expected'. It seems it unable to find sap.ui.localResources.

What should i do? And also, when i modified the code and accessing this index.html, i can't see the updated code (view source) in explorer/chrome.

any idea?

- --------- Index.html code-----

<!DOCTYPE HTML>

<html>

       <head>

              <meta http-equiv="X-UA-Compatible" content="IE=edge">

                 <script src="./resources/sap-ui-core.js"

                      id="sap-ui-bootstrap"

                      data-sap-ui-libs="sap.ui.commons"

                      data-sap-ui-theme="sap_goldreflection" >

              </script>

              <!-- add sap.ui.table,sap.ui.ux3 and/or other libraries to 'data-sap-ui-libs' if required -->

                 <script>

                     sap.ui.localResources("demoui5");

                     var view = sap.ui.view({id:"iddemo1", viewName:"demoui5.demo", type:sap.ui.core.mvc.ViewType.JS});

                        view.placeAt("content");

                 </script>

       </head>

       <body class="sapUiBody" role="application">

              <div id="content"></div>

       </body>

</html>

-------------------------------------------- End -------------

Thanks,

naresh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Jibin & sandip,

Thanks for the responses.

I see two issues here.

1. When i do the changes to html and tried to access the page, i am not seeing the changes immediately. I think some cache issues.

    Atatched is the index.html.

2. I am getting different error after i added functions to it. Atatched is the screenshot of chrome.

Appreciate your help.

Thanks,

Naresh

jibin_joy
Contributor
0 Kudos

Hi Naresh,

Its syntax error ........

there are many ways to bind function

plz check attachment for the basic 3 ways for binding function

Regards,

Jibin Joy

Former Member
0 Kudos

Thanks Jibin. That worked.

I got into another problem, this time the response is not showing in the html page once i click submit on index.html.

Once i click Submit button, it suppose to delete the record from table and show the response as "Number of records updated:"+Count.

But from index.html, its not moving to the response page at all.

In my xsjs i am using the below statements.

$.response.contentType= "text/html";

$.response.setBody("Number of records updated:"+count);

$.response.status=$.net.http.OK;

Thanks for the help.

Naresh

jibin_joy
Contributor
0 Kudos

Hi Naresh,

Can u post me that JS file

Regards,

Jibin Joy

Former Member
0 Kudos

Here it is.

Thanks,

Naresh

Answers (2)

Answers (2)

SandipAgarwalla
Active Contributor
0 Kudos

double check the path to your UI5 libs

<script src="./resources/sap-ui-core.js"


jibin_joy
Contributor
0 Kudos

Hi Naresh ,

   use FireFox firebug tool to figure the error detail if  possible can u  post me screen shot  for that error ..

Regards,

Jibin Joy