Adjust behaviour of numberEditor - add clear button, and explanitory text for when...
[potlatch2.git] / net / systemeD / potlatch2 / mapfeatures / editors / FreeTextEditor.mxml
index 310ba08f42d1d190b88a6049ad847fbbc062dc1e..1215620a8541383c01098dda641286b048d75662 100644 (file)
@@ -2,12 +2,21 @@
 <edit:SingleTagEditor
        xmlns:mx="http://www.adobe.com/2006/mxml" 
        xmlns:edit="net.systemeD.potlatch2.mapfeatures.editors.*"
-       verticalGap="0"
+       xmlns:flexlib="flexlib.controls.*"
        width="100%"
-       toolTip="{fieldDescription}">
+       toolTip="{fieldDescription}"
+    direction="{fieldDirection}" styleName="titledEditor">
 
   <mx:Label text="{fieldName}:"/>
-  <mx:TextInput id="inputBox" text="{value}" width="100%" change="value = inputBox.text"/>
+  <flexlib:PromptingTextInput id="inputBox" prompt="{prompt}" text="{value}" width="100%" change="value = inputBox.text"/>
 
+  <mx:Script><![CDATA[
+  
+      [Bindable(event="factory_set")]
+      protected function get prompt():String {
+          return _factory == null ? null : FreeTextEditorFactory(_factory).notPresentText;
+      }
+      
+  ]]></mx:Script>
 </edit:SingleTagEditor>