NEXACRO

넥사크로N24 : 데이터 통신(Transaction)

웨일파도 2025. 6. 24. 17:35
반응형

데이터통신을 통해 조회 추가 삭제 저장 를 해보려 한다

 

 

조회 (Retrieve)

 

1) 버튼의 Properties >  Event 에서 onclick 을 마우스로 더블클릭한다

2) Script 화면에 함수가 생긴다

 

3) 함수 작성

this.btn_retrieve_onclick = function(obj:nexacro.Button,e:nexacro.ClickEventInfo)
{
	this.transaction("strSelect" , // 서비스 구분좌
			"SvcUrl::select_emp.jsp", // 호출할 url
			"", // 저장 server ds = client ds
			"ds_emp=out_emp", // 조회 client ds=server ds (스페이스 넣으면 안됨)
			"a=b c=" + nexacro.wrapQuote("a d"), // 전달값
			"fnCallback" ); // 콜백함수 서비스의 끝
};

 

<SvcUrl 찾는법>

TypeDefinition > Services 에 User Service 에 데이터를 불러올 url 을 정의해두었다

 

 

추가 (Add)

this.btn_add_onclick = function(obj:nexacro.Button,e:nexacro.ClickEventInfo)
{
	this.ds_emp.addRow();
	this.ds_emp.setColumn(this.ds_emp.rowposition,"HIRE_DATE","20250624");
};

 

삭제 (Delete)

this.btn_delete_onclick = function(obj:nexacro.Button,e:nexacro.ClickEventInfo)
{
	this.ds_emp.deleteRow(this.ds_emp.rowposition);
};

 

저장 (Save)

this.btn_save_onclick = function(obj:nexacro.Button,e:nexacro.ClickEventInfo)
{
	this.transaction("strSave" , // 서비스 구분좌
                "SvcUrl::save_emp.jsp", // 호출할 url
                "in_emp=ds_emp:u", // 저장 server ds = client ds
                "", // 조회 client ds=server ds (스페이스 넣으면 안됨)
                "a=b c=" + nexacro.wrapQuote("a d"), // 전달값
                "fnCallback" ); // 콜백함수 서비스의 끝
};

 

 

로딩 시

this.form_onload = function(obj:nexacro.Form,e:nexacro.LoadEventInfo)
{
	this.transaction("strCode" , // 서비스 구분좌
            "SvcUrl::select_code.jsp", // 호출할 url
            "", // 저장 server ds = client ds
            "ds_dept=out_dept ds_pos=out pos ds_skill=out_skill ds_hobby=out_hobby", // 조회 client ds=server ds (스페이스 넣으면 안됨)
            "a=b c=" + nexacro.wrapQuote("a d"), // 전달값
            "fnCallback" ); // 콜백함수 서비스의 끝
};
반응형

'NEXACRO' 카테고리의 다른 글

넥사크로N24 : 그리드 표현식  (0) 2025.06.24
넥사크로N24 : 바인딩하는 3가지 방법  (0) 2025.06.24