주소록 메모저장시 개행문자 오류 수정
@5496457b535e5182a5f38bfd083233ff6521464d
--- src/main/java/itn/let/mjo/addr/web/AddrController.java
+++ src/main/java/itn/let/mjo/addr/web/AddrController.java
... | ... | @@ -485,6 +485,43 @@ |
| 485 | 485 |
return "/web/addr/AddrListPrint"; |
| 486 | 486 |
} |
| 487 | 487 |
|
| 488 |
+ /** |
|
| 489 |
+ * 주소록 상세정보 ajax |
|
| 490 |
+ * @param addrCheck |
|
| 491 |
+ * @param request |
|
| 492 |
+ * @param addrVO |
|
| 493 |
+ * @param model |
|
| 494 |
+ * @param redirectAttributes |
|
| 495 |
+ * @return |
|
| 496 |
+ * @throws Exception |
|
| 497 |
+ */ |
|
| 498 |
+ @RequestMapping("/web/mjon/addr/selectAddrDetailAjax.do")
|
|
| 499 |
+ public ModelAndView selectAddrDetailAjax(HttpServletRequest request, |
|
| 500 |
+ AddrVO addrVO, Model model) throws Exception {
|
|
| 501 |
+ |
|
| 502 |
+ ModelAndView modelAndView = new ModelAndView(); |
|
| 503 |
+ modelAndView.setViewName("jsonView");
|
|
| 504 |
+ |
|
| 505 |
+ boolean isSuccess = true; |
|
| 506 |
+ String msg = ""; |
|
| 507 |
+ AddrVO addrInfo = null; |
|
| 508 |
+ |
|
| 509 |
+ try {
|
|
| 510 |
+ |
|
| 511 |
+ addrInfo = addrService.selectAddrDetail(addrVO); |
|
| 512 |
+ |
|
| 513 |
+ } catch (Exception e) {
|
|
| 514 |
+ isSuccess = false; |
|
| 515 |
+ msg = e.getMessage(); |
|
| 516 |
+ } |
|
| 517 |
+ |
|
| 518 |
+ modelAndView.addObject("isSuccess", isSuccess);
|
|
| 519 |
+ modelAndView.addObject("msg", msg);
|
|
| 520 |
+ modelAndView.addObject("addrInfo", addrInfo);
|
|
| 521 |
+ |
|
| 522 |
+ return modelAndView; |
|
| 523 |
+ |
|
| 524 |
+ } |
|
| 488 | 525 |
|
| 489 | 526 |
|
| 490 | 527 |
/** |
--- src/main/webapp/WEB-INF/jsp/web/addr/AddrListAjax.jsp
+++ src/main/webapp/WEB-INF/jsp/web/addr/AddrListAjax.jsp
... | ... | @@ -214,12 +214,32 @@ |
| 214 | 214 |
} |
| 215 | 215 |
|
| 216 | 216 |
//메모 레이어 열 때 메모 데이터 전달 |
| 217 |
-function memoOpen(comment, id) {
|
|
| 217 |
+function memoOpen(id) {
|
|
| 218 | 218 |
var form = document.addrMemoForm; |
| 219 | 219 |
form.addrCheck.value=id; |
| 220 |
- $('#textareaMemo').text(comment);
|
|
| 221 |
- |
|
| 220 |
+ |
|
| 221 |
+ // 메모내용 가져오기 |
|
| 222 |
+ $.ajax({
|
|
| 223 |
+ url : "<c:url value='/web/mjon/addr/selectAddrDetailAjax.do'/>", |
|
| 224 |
+ type : 'POST', |
|
| 225 |
+ data : {"addrId" : id},
|
|
| 226 |
+ dataType:'json', |
|
| 227 |
+ async: false, |
|
| 228 |
+ success : function(data, status){
|
|
| 229 |
+ if(data.isSuccess == true) {
|
|
| 230 |
+ $('#textareaMemo').text(data.addrInfo.addrComment);
|
|
| 231 |
+ } |
|
| 232 |
+ else {
|
|
| 233 |
+ //alert("Message : " + msg);
|
|
| 234 |
+ } |
|
| 235 |
+ }, |
|
| 236 |
+ error: function (e) {
|
|
| 237 |
+ console.log("ERROR : ", e);
|
|
| 238 |
+ alert("에러가 발생했습니다.");
|
|
| 239 |
+ } |
|
| 240 |
+ }); |
|
| 222 | 241 |
} |
| 242 |
+ |
|
| 223 | 243 |
// 메모 저장 |
| 224 | 244 |
function updateMemo() {
|
| 225 | 245 |
var form = document.addrMemoForm; |
... | ... | @@ -768,7 +788,7 @@ |
| 768 | 788 |
</p> |
| 769 | 789 |
</td> |
| 770 | 790 |
<td> |
| 771 |
- <button type="button" onclick="memoOpen('<c:out value='${result.addrComment}' />','<c:out value='${result.addrId}' />'); return false;" data-tooltip="adr_popup13">
|
|
| 791 |
+ <button type="button" onclick="memoOpen('<c:out value="${result.addrId}" />'); return false;" data-tooltip="adr_popup13">
|
|
| 772 | 792 |
<img src="/publish/images/content/memo_img.png" alt="메모"> |
| 773 | 793 |
</button> |
| 774 | 794 |
</td> |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?