empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From doeb...@apache.org
Subject svn commit: r701551 - /incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/controls/TextAreaInputControl.java
Date Fri, 03 Oct 2008 22:11:52 GMT
Author: doebele
Date: Fri Oct  3 15:11:51 2008
New Revision: 701551

URL: http://svn.apache.org/viewvc?rev=701551&view=rev
Log:
EMPIREDB-24

Modified:
    incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/controls/TextAreaInputControl.java

Modified: incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/controls/TextAreaInputControl.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/controls/TextAreaInputControl.java?rev=701551&r1=701550&r2=701551&view=diff
==============================================================================
--- incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/controls/TextAreaInputControl.java
(original)
+++ incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/controls/TextAreaInputControl.java
Fri Oct  3 15:11:51 2008
@@ -111,6 +111,18 @@
         input.addAttribute("disabled", ci.getDisabled());
         input.addAttribute("rows",  Math.max(ci.getVSize(), 2));
         input.addAttribute("cols",  Math.max(ci.getHSize(), 1));
+        // maxlength
+        if (ci.getDisabled()==false)
+        {   // Get Max Length
+            int maxLength = (int)ci.getColumn().getSize();
+            String checklength = getFormatOption(ci, "maxlength:");
+            if (StringUtils.isValid(checklength) && maxLength>0)
+            {   // Do lengthcheck via onKeyPress and onKeyUp Events
+                checklength = StringUtils.replace(checklength, "{0}", String.valueOf(maxLength));

+                input.addAttribute("onkeypress", checklength);
+                input.addAttribute("onkeyup",    checklength);
+            }   
+        }
         // Event Attributes
         input.addAttribute("onclick",   ci.getOnclick());
         input.addAttribute("onchange",  ci.getOnchange());



Mime
View raw message