○ 룰 빌더 페이지 컨트롤러 계속해서 분석하기
- [ page.controller.js ]
loadRequests: function (mPath) {
// The mock server does not support 1 to 1 navigation.
// Hence we provide the responses directly
by adding custom requests to the MockServer
var oRresponses = {};
var getData = function(json) {
oRresponses = json;
};
this.loadJSON(mPath, getData);
var aRequests = this.oRuleMockServer.getRequests();
var sMethod = "GET";
var sPath = /Rules\(Id='FA163E38C6481EE785F409DCAD583D43',
Version='000001'\)\/DecisionTable\/DecisionTableRows\/\$count/;
var fnResponse1 = function (xhr) {
xhr.respond(200, {
"Content-Type": "text/plain;charset=utf-8"
}, "5");
};
1) loadRequests : 'mPath'를 파라미터로 해당 이벤트 설정을 진행한다.
* mock 서버는 1 대 1 navigation으로 지원되지 않는다.
* MockServer에 고객의 request를 즉시 추가함으로써 그에 대한 response를 제공한다.
2) oResponses : 빈값으로 변수를 선언한다.
* getData : 'json'을 매개로 두어 'oResponse' 값이 'json' 값임을 명시해 둔다.
3) loadJSON : 파라미터로 두었던 'mPath'를 경로로 두어 위에서 설정해두었던 'getData'를 통해 데이터를 가져온다.
What is the 'loadJSON()'?
loadJSON() loadJSON() - 제공된 위치에서 검색된 텍스트를 기반으로 JSON 객체를 생성한다. 1) 이 함수 사용 시, 표준 HTTP 요청을 사용해 JSON 지원 서버에서 콘텐츠를 검색할 수 있다. 2) WordPress(JSON API 플
pythonchoboman.tistory.com
var aRequests = this.oRuleMockServer.getRequests();
var sMethod = "GET";
var sPath = /Rules\(Id='FA163E38C6481EE785F409DCAD583D43',
Version='000001'\)\/DecisionTable\/DecisionTableRows\/\$count/;
var fnResponse1 = function (xhr) {
xhr.respond(200, {
"Content-Type": "text/plain;charset=utf-8"
}, "5");
};
4) sRequests : 'oRuleMockServer'에 'getRequests()' 메서드를 통해 mock server 요청을 받는 변수를 초기화 한다.
5) sMethod : 메서드는 'GET' 방식으로 선언해 둔다.
6) fnResponse1 : xhr을 파라미터로 둔다.
* 파라미터로 두었던 'xhr'의 'respond'는 '200'으로 지정해 문서가 있을 때의 경우로 둔다.
* 'content-Type'을 'application'의 'json'과 'charset'은 'utf-8'로 설정한다.
7) 'method'는 'GET' 방식의 'sMethod'로, 경로는 'sPath'로
'response'는 'fnResponse1'을 가지는 'sRequests' 값을 'push'한다.
What is the 'RuleBuilder'?
SAPUI5 SDK - Demo Kit sapui5.hana.ondemand.com class.sap.rules.ui.RuleBuilder class.sap.rules.ui.RuleBuilder - 초기 속성 값, 집합적이고 서로 연결된 객체, 이벤트 핸들러를 정의하는 객체 데이터를 가지는 mSettings를 허용
pythonchoboman.tistory.com
Next Stage : Rule Builder Control / Decision Table - 5
Rule Builder Control / Decision Table - 5
○ 사용자가 데이터를 편집 및 수정할 수 있도록 세팅 버튼을 만들어 준다. - [ Page.view.xml ] 1) view에 controller에서 설정해두었던 'id' 'rulebuilder'를 불러와 RuleBuilder를 보여준다. * 'types'를 'DecisionTable'
pythonchoboman.tistory.com
'SAP > UI5' 카테고리의 다른 글
[ SAPUI5 ] Smart Field (4) | 2023.03.08 |
---|---|
[ SAPUI5 ] Rule Builder Control / Decision Table - 5 (5) | 2023.03.07 |
[ SAPUI5 ] Rule Builder Control / Decision Table - 3 (3) | 2023.03.06 |
[ SAPUI5 ] Rule Builder Control / Decision Table - 2 (2) | 2023.03.06 |