diff --git a/src/main/java/kr/xit/framework/support/tag/code/CodeRadioBoxTag.java b/src/main/java/kr/xit/framework/support/tag/code/CodeRadioBoxTag.java new file mode 100644 index 00000000..91b11c53 --- /dev/null +++ b/src/main/java/kr/xit/framework/support/tag/code/CodeRadioBoxTag.java @@ -0,0 +1,76 @@ +package kr.xit.framework.support.tag.code; + +import java.io.IOException; +import java.util.List; +import java.util.Map; + +import javax.servlet.jsp.JspException; +import javax.servlet.jsp.JspWriter; +import javax.servlet.jsp.tagext.TagSupport; + +import org.springframework.util.StringUtils; + +import kr.xit.framework.biz.cmm.CacheCodeUtils; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class CodeRadioBoxTag extends TagSupport { + + private static final long serialVersionUID = 519803737380451566L; + + private String id = ""; + private String name = ""; + private String codeId = ""; + private String defaultSelect = ""; + private String cls = ""; + private String alt = ""; + private String onclick = ""; + + public int doStartTag() throws JspException { + JspWriter out = pageContext.getOut(); + try { + StringBuilder sb = new StringBuilder(); + + // Map paramMap = new HashMap(); + // paramMap.put("codeId", this.codeId); + // paramMap.put("code", this.code); + // paramMap.put("etc_1", this.etc_1); + // paramMap.put("etc_2", this.etc_2); + // paramMap.put("etc_3", this.etc_3); + + List> list = CacheCodeUtils.getComboCodes(codeId); + + int index = 0; + for (Map map : list) { + + sb.append("").append("\n"); + + sb.append("").append("\n"); + + index++; + } + out.print(sb.toString()); + } catch (IOException ie) { + throw new JspException(ie.toString()); + } + return SKIP_BODY; + } + + private String isDefaultSelect(String defaultSelectValue) { + if(StringUtils.hasText(this.defaultSelect) && this.defaultSelect.equals(defaultSelectValue)) + return " checked='checked'"; + return ""; + } + +} diff --git a/src/main/java/kr/xit/framework/support/tag/code/CodeSelectBoxTag.java b/src/main/java/kr/xit/framework/support/tag/code/CodeSelectBoxTag.java new file mode 100644 index 00000000..d84b7456 --- /dev/null +++ b/src/main/java/kr/xit/framework/support/tag/code/CodeSelectBoxTag.java @@ -0,0 +1,96 @@ +package kr.xit.framework.support.tag.code; + +import java.io.IOException; +import java.util.List; +import java.util.Map; + +import javax.servlet.jsp.JspException; +import javax.servlet.jsp.JspWriter; +import javax.servlet.jsp.tagext.TagSupport; + +import org.springframework.context.i18n.LocaleContextHolder; +import org.springframework.context.support.MessageSourceAccessor; +import org.springframework.util.StringUtils; + +import kr.xit.framework.biz.cmm.CacheCodeUtils; +import kr.xit.framework.support.util.JBeanRegistry; +import kr.xit.framework.support.util.constants.MessageKey; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class CodeSelectBoxTag extends TagSupport { + + private static final long serialVersionUID = 519803737380451566L; + + private String id = ""; + private String name = ""; + private String codeId = ""; + private String etc_1 = ""; + private String etc_2 = ""; + private String etc_3 = ""; + private String defaultSelect = ""; + private boolean isEmptySelect = true; + private String emptyMessageKey = MessageKey.EMPTY_MSG_COMBO; + + private String sortField = ""; + private String cls = ""; + private String alt = ""; + private String onchange = ""; + private boolean disabled = false; + + + public int doStartTag() throws JspException { + JspWriter out = pageContext.getOut(); + try { + StringBuilder sb = new StringBuilder(); + sb.append(""); + + if(this.isEmptySelect){ + //out.print(""); + sb.append("").append("\n"); + } + + // Map paramMap = new HashMap(); + // paramMap.put("codeId", this.codeId); + // paramMap.put("code", this.code); + // paramMap.put("etc_1", this.etc_1); + // paramMap.put("etc_2", this.etc_2); + // paramMap.put("etc_3", this.etc_3); + + List> list = CacheCodeUtils.getComboCodes(codeId); + + for (Map map : list) { + //out.print(""); + sb.append("").append("\n"); + } + //out.print(""); + sb.append(""); + out.print(sb.toString()); + } catch (IOException ie) { + throw new JspException(ie.toString()); + } + return SKIP_BODY; + } + + private String isDefaultSelect(String defaultSelectValue) { + if(StringUtils.hasText(this.defaultSelect) && this.defaultSelect.equals(defaultSelectValue)) + return " selected='selected'"; + return ""; + } +} diff --git a/src/main/java/kr/xit/framework/support/util/constants/MessageKey.java b/src/main/java/kr/xit/framework/support/util/constants/MessageKey.java index 0c3eade9..a86cb90c 100644 --- a/src/main/java/kr/xit/framework/support/util/constants/MessageKey.java +++ b/src/main/java/kr/xit/framework/support/util/constants/MessageKey.java @@ -17,4 +17,6 @@ public abstract class MessageKey { public static final String CMM_DELETE_FAIL = "fail.common.delete"; public static final String WARN_SESSION_END = "warn.session.end";//세션이 종료 되었습니다.. + + public static final String EMPTY_MSG_COMBO = "button.select"; } diff --git a/src/main/webapp/WEB-INF/jsp/fims/biz/ec/ec0100Form.jsp b/src/main/webapp/WEB-INF/jsp/fims/biz/ec/ec0100Form.jsp index 0ea8c19e..92170958 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/biz/ec/ec0100Form.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/biz/ec/ec0100Form.jsp @@ -1,10 +1,6 @@ <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@ include file="/WEB-INF/jsp/framework/taglibs.jsp"%> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%> -<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>