Coverage Report - org.kuali.rice.kns.web.taglib.html.KNSButtonTag
 
Classes in this File Line Coverage Branch Coverage Complexity
KNSButtonTag
0%
0/9
0%
0/10
6
 
 1  
 /**
 2  
  * Copyright 2005-2011 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 org.apache.commons.lang.StringUtils;
 19  
 import org.apache.struts.action.ActionForm;
 20  
 import org.apache.struts.taglib.html.ButtonTag;
 21  
 import org.kuali.rice.kns.util.WebUtils;
 22  
 import org.kuali.rice.kns.web.struts.form.pojo.PojoForm;
 23  
 
 24  
 import javax.servlet.jsp.JspException;
 25  
 
 26  
 /**
 27  
  * This is a description of what this class does - wliang don't forget to fill this in. 
 28  
  * 
 29  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 30  
  *
 31  
  */
 32  0
 public class KNSButtonTag extends ButtonTag {
 33  
 
 34  
         /**
 35  
          * @see org.apache.struts.taglib.html.SubmitTag#doEndTag()
 36  
          */
 37  
         @Override
 38  
         public int doEndTag() throws JspException {
 39  0
                 int returnVal = super.doEndTag();
 40  0
                 if (!getDisabled() && !getReadonly()) {
 41  0
                 String name = prepareName();
 42  0
                 if (StringUtils.isNotBlank(name)) {
 43  0
                         ActionForm form = WebUtils.getKualiForm(pageContext);
 44  0
                     if(form!=null && form instanceof PojoForm) {
 45  0
                             ((PojoForm) form).registerEditableProperty(name);
 46  
                     }
 47  
                 }
 48  
         }
 49  0
                 return returnVal;
 50  
         }
 51  
 
 52  
 }