001/**
002 * Copyright 2005-2016 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.rice.kns.web.taglib.html;
017
018import org.apache.commons.lang.StringUtils;
019import org.apache.struts.action.ActionForm;
020import org.apache.struts.taglib.html.SelectTag;
021import org.kuali.rice.kns.util.WebUtils;
022import org.kuali.rice.kns.web.struts.form.pojo.PojoForm;
023
024import javax.servlet.jsp.JspException;
025
026/**
027 * This is a description of what this class does - wliang don't forget to fill this in. 
028 * 
029 * @author Kuali Rice Team (rice.collab@kuali.org)
030 *
031 * @deprecated KNS Struts deprecated, use KRAD and the Spring MVC framework.
032 */
033@Deprecated
034public class KNSSelectTag extends SelectTag {
035
036        /**
037         * @see org.apache.struts.taglib.html.SelectTag#doEndTag()
038         */
039        @Override
040        public int doEndTag() throws JspException {
041                int returnVal = super.doEndTag();
042        if (!getDisabled() && !getReadonly()) {
043                String name = prepareName();
044                if (StringUtils.isNotBlank(name)) {
045                        ActionForm form = WebUtils.getKualiForm(pageContext);
046                    if(form!=null && form instanceof PojoForm) {
047                        ((PojoForm) form).registerEditableProperty(name);
048                    }
049                }
050        }
051                return returnVal;
052        }
053
054}