2016-10-31 9 views
0

"view"폴더에서보기를로드하려고하면 "resource view/View1.view.xml에서 resources/view/View1.view.xml에서로드 할 수 없습니다"오류가 발생합니다. WebIDE의 폴더 구조는 아래 그림과 같습니다.리소스 뷰/View1.view.xml에서 리소스/뷰/View1.view.xml을로드 할 수 없습니다. WebIDE에서

WebIDE Folder structure :-

index.html을

<!DOCTYPE HTML> 
<html> 
<head> 
<script id="sap-ui-bootstrap" 
     src="resources/sap-ui-core.js" 
     data-sap-ui-libs="sap.m" 
     data-sap-ui-theme="sap_bluecrystal" > 
</script> 
    <script> 
     sap.ui.localResources("webapp"); 
     var app = new sap.m.App("idApp"); 
     var view1 = sap.ui.view({id:"idView1", 
     viewName:"view.View1",type:sap.ui.core.mvc.ViewType.XML}); 
    </script> 
</head> 
<body class="sapUiBody" role="application"> 
    <div id="content" ></div> 
</body> 
</html> 

View1.xml

<mvc:View 
      xmlns="sap.m" 
      xmlns:mvc="sap.ui.core.mvc"> 
<Text id="idbtn" text="Text from" /> 

</mvc:View> 

View1.controller

sap.ui.define([ 
    "sap/ui/core/mvc/Controller" 
], function(Controller) { 
    "use strict"; 

    return Controller.extend("View1"); 

}); 

신 app.json

나는 여러 가지 방법을 시도하고 사전에

감사합니다, Srini을 View1.xml 가리 할 수있는 방법을 찾을 수 없습니다 enter image description here

브라우저에서 는

{ 
    "routes": [ 
    { 
     "path": "/webapp/resources", 
     "target": { 
     "type": "service", 
     "name": "sapui5", 
     "entryPath": "/resources" 
     }, 
     "description": "SAPUI5 Resources" 
    } 
    ] 
} 

오류입니다.

답변

0

sap.ui.localResources("webapp");웹 응용 프로그램 네임 스페이스의 webapp 폴더를 등록합니다. 콘솔에서도 볼 수 있습니다.

따라서 viewName: "webapp.view.View1"이어야합니다.

return Controller.extend("webapp.controller.View1", { 

...

+0

@schnoadel, 나는 당신의 제안에 따라 뷰 이름 사양을 변경 :

또한 컨트롤러가 다음 webapp.controller.View1로 알려져 있습니다. 여전히 오류가 발생합니다. 콘솔에서 폴더 경로의 차이를 볼 수는 있지만 여전히 작동하지 않습니다. 변경 후 콘솔의 경로는 ** webapp/webapp/view/View1.view.xml **로 반영됩니다. – SriniRao