Jam's story

넥사크로17 데이터통신 본문

Nexacro17

넥사크로17 데이터통신

애플쩀 2023. 11. 19. 22:51

조회버튼 

 

svcURL 기본값을 설정되어있다

 

// Retrieve Button 조회버튼
//조회버튼 클릭하면 이 함수가 만들어짐 
//f1-transaction-form 에서 가져왓음 

this.btn_retrieve_onclick = function(obj:nexacro.Button,e:nexacro.ClickEventInfo)
{
	var sDeptCd = this.div_search.form.edt_dept_cd.value;
	
	this.transaction("svcSelect" //서비스 
				    ,"SvcURL::select_emp.jsp?sDept="+sDeptCd  //http://demo.nexacro.com/edu/nexacro17/select_emp.jsp?sDept="+sDeptCd  와 같다 
					,"" //저장 
					,"ds_emp=out_emp" // 조회  client ds= server ds 데이터셋 매칭 
					,"" //
					,"fn_callback");					
};

 

콜백함수

//콜백함수는 무조건 파라미터 3개 
//에러코드와 메세지는 서버 jsp단에서 넘겨준다 

this.fn_callback = function(svcID, errCD, errMSG)
{
	if(errCD < 0){ //실패 
		this.alert("Error: " + errMSG);
		return;
	} //성공 
	if(svcID == "svcSelect"){
		this.alert("Select Success");
	}
	else if(svcID == "svcSave"){
		this.alert("Save Success");
	}
}

this.fn_callback= function(svcID, errCD, errMSG){
if(errCD>=0){ //성공
 if(svcid=="strSelect"){
	alert(this.ds_emp.getRowCount()+"건");
 }
}else{
	alert("Error"+ecd+":"+emsg);
}
}

 

 

저장버튼 

// Save Button
this.btn_save_onclick = function(obj:nexacro.Button,e:nexacro.ClickEventInfo)
{
	var sForm  = this.name;
	var sTitle = nexacro.wrapQuote(this.titletext);
	this.transaction("svcSave" //서비스 id
					,"SvcURL::save_emp.jsp"
					,"in_emp=ds_emp:u" //저장 server ds=client ds 
					//:u는 업데이트된 정보만 넘김 - 성능에 영향을 주기때문에 무조건 u 
					//:A는 모두 넘김 
					,"" //조회 
					,"in_var1="+sTitle+" in_var2="+sForm 
					,"fn_callback");		
};

 

 

onload 이벤트 

//1번째 방법 
this.Form_onload = function(obj:nexacro.Form,e:nexacro.LoadEventInfo)
{
	if(nexacro.getEnvironmentVariable("ev_runMode") == "S" ||
	   system.navigatorname.substr(0,7) == "nexacro"){
		this.fn_init(obj);
	}

};


//2번쨰방법 
this.Form_onload = function(obj:nexacro.Form,e:nexacro.LoadEventInfo)
{
this.transaction("strCode" //서비스 id
				    ,"SvcURL::select_code.jsp?arg=1&arg2=2"
					,"" //저장 
					,"ds_dept=out_dept ds_pos=out_pos" // 조회  client ds= server ds 데이터셋 매칭
					//n개의 데이터를 가져올때는 공백
					,"arg=1 arg2="+nexacro.wrapQuote("2, 3")
					,"fn_callback");		
};

 

 

 

 Resize 

 

 

컴포넌트 사이즈  px -> % 변화 

%로 변화하면 화면이 줄어들면 그것에 맞게 버튼(컴포넌트)도 줄어든다 

 

버튼이 줄은 만큼, 옆에있는 컴포넌트도 따라오도록 하는 방법 

 

하고 , 엔터를 누른다 

 

 

데이터 사이즈에 맞게 , 컴포넌트 사이즈 자동변경 

 

 

FitToContents

 

데이터에 따라서 컴포넌트 크기와 위치가 달라짐

 내용이 늘어나면, 밑,옆으로 늘어남

 

summary의 크기와 위치를 데이터의 양에 따라 변경해보자 

 

높이를 다르게 하겠다는 뜻 

밑의 컨텐츠를 클릭하여, top -summary를 설정 

summary를 따라다니겠다는 뜻 

this.CompBase_ArrangeFit_onbindingvaluechanged = function(obj:nexacro.Form,e:nexacro.BindingValueChangedEventInfo)
{
	this.resetScroll();
};
Comments