Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[버그수정] 410. 주간/월간보고관리 > Uncaught TypeError 오류 수정 및 마크업 개선 #507

Open
wants to merge 2 commits into
base: contribution
Choose a base branch
from

Conversation

taeseong
Copy link

수정 사유 Reason for modification

소스를 수정한 사유가 무엇인지 체크해 주세요. Please check the reason you modified the source. ([X] X는 대문자여야 합니다.)

  • 버그수정 Bug fixes
  • 기능개선 Enhancements
  • 기능추가 Adding features
  • 기타 Others

수정된 소스 내용 Modified source

수정된 파일

  • EgovWikMnthngReprtList.jsp

수정 내용

  • fn_egov_inqire_wikmnthngreprt 스크립트의 Uncaught TypeError 에러 수정
    • reprtId 을 포함하고 있는 form 이름으로 변경 frmwikMnthngReprtFrm

AS-IS

function fn_egov_inqire_wikmnthngreprt(reprtId) {
	document.frm.reprtId.value = reprtId;
	document.frm.action = "<c:url value='/cop/smt/wmr/selectWikMnthngReprt.do'/>";
	document.frm.submit();
}

TO-BE

function fn_egov_inqire_wikmnthngreprt(reprtId) {
	document.wikMnthngReprtFrm.reprtId.value = reprtId;
	document.wikMnthngReprtFrm.action = "<c:url value='/cop/smt/wmr/selectWikMnthngReprt.do'/>";
	document.wikMnthngReprtFrm.submit();
}
  • <c:forEach> loop 내에서 반복적으로 form과 input box들을 생성하는 마크업을 분리

AS-IS

		<c:forEach var="result" items="${resultList}" varStatus="status">
		  <tr>
		    <td><c:out value="${(searchVO.pageIndex-1) * searchVO.pageSize + status.count}"/></td>
		    <td><c:out value="${result.reprtSe}"/></td>
		    <td><c:out value="${result.reprtDe}"/></td>
		    <td>
                      <!-- form을 데이터 개수만큼 반복으로 생성하고 submit을 통해 상세화면으로 이동함 -->
		     <form name="wikMnthngReprtVO" method="post" action="<c:url value='/cop/smt/wmr/selectWikMnthngReprt.do'/>">
			   <input name="pageIndex" type="hidden" value="<c:out value='${searchVO.pageIndex}'/>">
			    <input name="searchCnd" type="hidden" value="<c:out value='${searchVO.searchCnd}'/>">
			    <input name="searchWrd" type="hidden" value="<c:out value='${searchVO.searchWrd}'/>">
			    <input name="searchDe" type="hidden" value="<c:out value='${searchVO.searchDe}'/>">
			    <input name="searchBgnDe" type="hidden" value="<c:out value='${searchVO.searchBgnDe}'/>">
			    <input name="searchEndDe" type="hidden" value="<c:out value='${searchVO.searchEndDe}'/>">
			    <input name="searchSttus" type="hidden" value="<c:out value='${searchVO.searchSttus}'/>">
				<input type="hidden" name="reprtId" value="<c:out value="${result.reprtId}"/>">
				<span class="link"><input type="submit" value="<c:out value="${result.reprtSj}"/>" onclick="fn_egov_inqire_wikmnthngreprt('<c:out value="${result.reprtId}"/>'); return false;" style="text-align : left;"></span>
				</form>
			<tr>
			<td><c:out value="${(searchVO.pageIndex-1) * searchVO.pageSize + status.count}"/></td>
			<td><c:out value="${result.reprtSe}"/></td>
			<td><c:out value="${result.reprtDe}"/></td>
			<td>
				<a href="#" onclick="fn_egov_inqire_wikmnthngreprt('<c:out value="${result.reprtId}"/>'); return false;"><c:out value="${result.reprtSj}"/></a>
			<td><c:out value="${result.confmDt}"/></td>
			</tr>
		</c:forEach>

TO-BE

	<c:forEach var="result" items="${resultList}" varStatus="status">
		<tr>
		<td><c:out value="${(searchVO.pageIndex-1) * searchVO.pageSize + status.count}"/></td>
		<td><c:out value="${result.reprtSe}"/></td>
		<td><c:out value="${result.reprtDe}"/></td>
		<td>
                        <!-- td 내에 있던 form을 분리 -->
			<a href="#" onclick="fn_egov_inqire_wikmnthngreprt('<c:out value="${result.reprtId}"/>'); return false;"><c:out value="${result.reprtSj}"/></a>
		</td>
		<td><c:out value="${result.reprtBgnDe}"/>~<c:out value="${result.reprtEndDe}"/></td>
		<td><c:out value="${result.wrterNm}"/></td>
		<td><c:out value="${result.confmDt}"/></td>
		</tr>
	</c:forEach>

        <!--생략 ... -->

        <!-- 하나의 form에서 처리-->
	<form name="wikMnthngReprtFrm" method="post" action="<c:url value='/cop/smt/wmr/selectWikMnthngReprt.do'/>">
		<input name="pageIndex" type="hidden" value="<c:out value='${searchVO.pageIndex}'/>">
		<input name="searchCnd" type="hidden" value="<c:out value='${searchVO.searchCnd}'/>">
		<input name="searchWrd" type="hidden" value="<c:out value='${searchVO.searchWrd}'/>">
		<input name="searchDe" type="hidden" value="<c:out value='${searchVO.searchDe}'/>">
		<input name="searchBgnDe" type="hidden" value="<c:out value='${searchVO.searchBgnDe}'/>">
		<input name="searchEndDe" type="hidden" value="<c:out value='${searchVO.searchEndDe}'/>">
		<input name="searchSttus" type="hidden" value="<c:out value='${searchVO.searchSttus}'/>">
		<input type="hidden" name="reprtId" value="<c:out value="${result.reprtId}"/>">
	</form>

JUnit 테스트 JUnit tests

테스트를 완료하셨으면 다음 항목에 [대문자X]로 표시해 주세요. When you're done testing, check the following items.

  • JUnit 테스트 JUnit tests
  • 수동 테스트 Manual testing

테스트 브라우저 Test Browser

테스트를 진행한 브라우저를 선택해 주세요. Please select the browser(s) you ran the test on. (다중 선택 가능 you can select multiple) [X] X는 대문자여야 합니다.

  • Chrome
  • Firefox
  • Edge
  • Safari
  • Opera
  • Internet Explorer
  • 기타 Others

테스트 스크린샷 또는 캡처 영상 Test screenshots or captured video

수정 전

image

수정 후

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant