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.strutsel.taglib.html.ELRadioTag;
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 KNSELRadioTag extends ELRadioTag {
035        /**
036         * @see org.apache.struts.taglib.html.RadioTag#doEndTag()
037         */
038        @Override
039        public int doEndTag() throws JspException {
040                int returnVal = super.doEndTag();
041                if (!getDisabled() && !getReadonly()) {
042                String name = prepareName();
043                if (StringUtils.isNotBlank(name)) {
044                        ActionForm form = WebUtils.getKualiForm(pageContext);
045                    if(form!=null && form instanceof PojoForm) {
046                        ((PojoForm) form).registerEditableProperty(name);
047                    }
048                }
049        }
050                return returnVal;
051        }
052}