| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| KNSTextTag |
|
| 6.0;6 |
| 1 | /* | |
| 2 | * Copyright 2007-2008 The Kuali Foundation | |
| 3 | * | |
| 4 | * Licensed under the Educational Community License, Version 2.0 (the "License"); | |
| 5 | * you may not use this file except in compliance with the License. | |
| 6 | * You may obtain a copy of the License at | |
| 7 | * | |
| 8 | * http://www.opensource.org/licenses/ecl2.php | |
| 9 | * | |
| 10 | * Unless required by applicable law or agreed to in writing, software | |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 13 | * See the License for the specific language governing permissions and | |
| 14 | * limitations under the License. | |
| 15 | */ | |
| 16 | package org.kuali.rice.kns.web.taglib.html; | |
| 17 | ||
| 18 | import javax.servlet.jsp.JspException; | |
| 19 | ||
| 20 | import org.apache.commons.lang.StringUtils; | |
| 21 | import org.apache.struts.action.ActionForm; | |
| 22 | import org.apache.struts.taglib.TagUtils; | |
| 23 | import org.apache.struts.taglib.html.TextTag; | |
| 24 | import org.kuali.rice.kns.util.WebUtils; | |
| 25 | import org.kuali.rice.kns.web.struts.pojo.PojoForm; | |
| 26 | ||
| 27 | /** | |
| 28 | * This is a description of what this class does - bhargavp don't forget to fill this in. | |
| 29 | * | |
| 30 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
| 31 | * | |
| 32 | */ | |
| 33 | 0 | public class KNSTextTag extends TextTag { |
| 34 | ||
| 35 | /** | |
| 36 | * @see org.apache.struts.taglib.html.BaseInputTag#doEndTag() | |
| 37 | */ | |
| 38 | @Override | |
| 39 | public int doEndTag() throws JspException { | |
| 40 | 0 | int returnVal = super.doEndTag(); |
| 41 | 0 | if (!getDisabled() && !getReadonly()) { |
| 42 | 0 | String name = prepareName(); |
| 43 | 0 | if (StringUtils.isNotBlank(name)) { |
| 44 | 0 | ActionForm form = WebUtils.getKualiForm(pageContext); |
| 45 | 0 | if(form!=null && form instanceof PojoForm) { |
| 46 | 0 | ((PojoForm) form).registerEditableProperty(name); |
| 47 | } | |
| 48 | } | |
| 49 | } | |
| 50 | 0 | return returnVal; |
| 51 | } | |
| 52 | } |