Prevent keys/values exceeding 255 characters
authorRichard Fairhurst <richard@systemeD.net>
Sun, 3 Apr 2011 12:47:13 +0000 (13:47 +0100)
committerRichard Fairhurst <richard@systemeD.net>
Sun, 3 Apr 2011 12:47:13 +0000 (13:47 +0100)
net/systemeD/controls/AutoComplete.as
net/systemeD/halcyon/connection/actions/SetTagAction.as
net/systemeD/potlatch2/TagGrid.mxml

index a3eaa24..527b804 100644 (file)
@@ -81,6 +81,8 @@ package net.systemeD.controls {
                        setStyle("paddingLeft",0);
                        setStyle("paddingRight",0);
                        rowCount = 7;
+                       
+                       if (maxChars) textInput.maxChars=maxChars;
                }
                
                //--------------------------------------------------------------------------
@@ -93,6 +95,7 @@ package net.systemeD.controls {
                private var showingDropdown:Boolean=false;
                private var tempCollection:Object;
                private var dropdownClosed:Boolean=true;
+               public var maxChars:uint=0;
 
                //--------------------------------------------------------------------------
                //      Overridden Properties
index 625d039..9e3680d 100644 (file)
@@ -11,7 +11,7 @@ package net.systemeD.halcyon.connection.actions {
         public function SetTagAction(entity:Entity, key:String, value:String) {
             super(entity, "Set "+key+"="+value);
             this.key = key;
-            this.value = value;
+            this.value = value.substr(0,255);
         }
 
         public override function doAction():uint {
index 6abbd69..e455147 100644 (file)
@@ -19,6 +19,7 @@
                                                labelField="name"
                                                rowCount="10"
                                                restrict="&#x0020;-&#x10FFFF;"
+                                               maxChars="255" 
                                                typedText="{outerDocument.selectedItem.key}">
                                        <mx:Script><![CDATA[ import net.systemeD.potlatch2.mapfeatures.*; ]]></mx:Script>
                                        </controls:AutoComplete>
@@ -36,6 +37,7 @@
                                                labelField="name"
                                                rowCount="10"
                                                restrict="&#x0020;-&#x10FFFF;"
+                                               maxChars="255" 
                                                typedText="{outerDocument.selectedItem.value}">
                                        <mx:Script><![CDATA[ import net.systemeD.potlatch2.mapfeatures.*; ]]></mx:Script>
                                        </controls:AutoComplete>