diff --git a/WebContent/jsp/onl/admin/adapter/adapterManDetail.jsp b/WebContent/jsp/onl/admin/adapter/adapterManDetail.jsp index 511b06a..40d4a0d 100644 --- a/WebContent/jsp/onl/admin/adapter/adapterManDetail.jsp +++ b/WebContent/jsp/onl/admin/adapter/adapterManDetail.jsp @@ -168,7 +168,7 @@ function validateName(){ return checkError; } -function localSave(){ +function localSave(isSilent){ var key =$("input[name=ADPTRBZWKNAME]").val(); //객체 생성 var save ={}; @@ -217,8 +217,12 @@ function localSave(){ save["adapterPropGroup"]= adapterPropGroup; save["adapterProps"] = fullData; submitData[key]=save; - - alert("<%=localeMessage.getString("adapterDetail.saveAlertMsg1")%>"); + + if (!isSilent) { + alert("<%=localeMessage.getString("adapterDetail.saveAlertMsg1")%>"); + } else { + alert("어댑터 정보 저장 성공!"); + } } @@ -627,7 +631,7 @@ $(document).ready(function() { // CLIENTID 초기값에 따라 버튼 상태 설정 updateClientIdButtonStates(); - $("#btn_modify").click(function(){ + $("#btn_modify").click(function(){ // 검색용 if (!isValid()) return; // 수정 할 때만 confirm 실행. @@ -636,7 +640,15 @@ $(document).ready(function() { var r = confirm("<%=localeMessage.getString("adapterDetail.checkMsg4")%>"); if (r == false) return; } - + + // 25.12.16 수정시 어댑터 리스트 자동저장 + alert("어댑터의 정보를 저장을 먼저 진행합니다.") + var isSubSaveSuccess = ModifyPopCheckAndSave(true); + + if (!isSubSaveSuccess) { + alert("어댑터 정보 저장이 실패했습니다. 어댑터 정보를 확인해주세요."); + return; + } //공통부만 form으로 구성 var postData = $('#ajaxForm').serializeArray(); @@ -823,24 +835,33 @@ $(document).ready(function() { localSave(); chkAdapterCnt('add'); - }); - $("#btn_pop_modify").click(function(){ - // + }); + $("#btn_pop_modify").click(function(){ // 검색용 + ModifyPopCheckAndSave(false); + }); + + function ModifyPopCheckAndSave(isSilent) { var isDuplication = false; + $("select[name=ADAPTERLIST] option").each(function(){ if ($(this).val() == $("input[name=ADPTRBZWKNAME]").val()){ isDuplication = true; } }); - if (!isDuplication){ - alert("<%=localeMessage.getString("adapterDetail.checkMsg2")%>"); - return; - } - localSave(); - }); + if (!isDuplication){ + // 화면 저장시 기존 alert 표시, INSERT/UPDATE 시 메시지 표시하지 않음 + if (!isSilent) { + alert("<%=localeMessage.getString("adapterDetail.checkMsg2")%>"); + } + return false; + } + + localSave(isSilent); + return true; + } + $("#btn_pop_delete").click(function(){ - // var isDuplication = false; $("select[name=ADAPTERLIST] option").each(function(){ if ($(this).val() == $("input[name=ADPTRBZWKNAME]").val()){