Permalink
Browse files

csv import and sql import now keep existing key type when you go back

and change table display name.

Change-Id: Ie03e4a903400276eb6767ff2feda2e0ca53b6c66
  • Loading branch information...
adufilie committed May 16, 2012
1 parent dfdf933 commit e933dd8fbd11deabaf38dc246de896f407a2b2e8
@@ -36,7 +36,7 @@
<mx:HBox>
<mx:RadioButton id="keyTypeRadio" group="{shapeOrKey}" selected="true" label="{Strings.key_type}" textAlign="left" width="{_indent}" toolTip="{Strings.tip_key_type_radiobutton}"/>
<mx:HBox enabled="{keyTypeRadio.selected &amp;&amp; !refreshingKeyTypes}">
- <ui:CustomComboBox id="keyTypeCombo" editable="true" text="{keyType}" enabled="{keyTypeCombo.dataProvider.length > 0}" dataProvider="{AdminInterface.instance.keyTypes}" toolTip="{Strings.tip_key_type_dropdown}" valueCommit="keyType = keyTypeCombo.text"/>
+ <ui:CustomComboBox id="keyTypeCombo" editable="true" text="{_defaultKeyType}" enabled="{keyTypeCombo.dataProvider.length > 0}" dataProvider="{AdminInterface.instance.keyTypes}" toolTip="{Strings.tip_key_type_dropdown}" valueCommit="if (UIUtils.hasFocus(keyTypeCombo)) keyTypeIsSet = true;"/>
<mx:Button id="keyTypeRefresh" label="Refresh" click="getKeyTypes()" toolTip="{Strings.tip_refresh_key_types}"/>
</mx:HBox>
<!--mx:Button label="?" click="showHelpForKeyType()"/-->
@@ -46,6 +46,7 @@
<mx:Script>
<![CDATA[
import weave.Strings;
+ import weave.core.UIUtils;
import weave.services.AdminInterface;
import weave.services.DelayedAsyncInvocation;
@@ -78,14 +79,20 @@
public function get selectedKeyType():String
{
- if (keyTypeRadio.selected)
- return keyTypeCombo.text;
- else
- return '';
- }
-
- [Bindable] public var keyType:String = "";
+ if (keyTypeRadio.selected)
+ return keyTypeCombo.text;
+
+ return '';
+ }
+
+ public function set defaultKeyType(value:String):void
+ {
+ if (!keyTypeIsSet)
+ _defaultKeyType = value;
+ }
+ [Bindable] private var _defaultKeyType:String = '';
+ private var keyTypeIsSet:Boolean = false;
[Bindable] private var refreshingGeoms:Boolean = false;
[Bindable] private var refreshingKeyTypes:Boolean = false;
@@ -34,7 +34,7 @@
<ui:TextInputWithPrompt id="csvFileNameInput" prompt="Select a CSV file." change="enableAllWidgets(csvFileNameInput.text.length > 0)" editable="true"/>
<mx:Button label="Upload File" click="browseAndUpload();"/>
<mx:Button label="Choose File on Server" click="openServerBrowser();" />
- <mx:Text text="{fileStatus.text}" id="fileStatus"/>
+ <mx:Text id="fileStatus"/>
</ui:Indent>
<mx:VBox visible="{csvFileNameInput.asTextInput().text.length > 0}">
<admin:SQLTableSelectorDialog id="tableSelector" showTableCombo="false" tableOverwriteCheckVisible="{AdminInterface.instance.currentUserIsSuperuser}"/>
@@ -69,7 +69,7 @@
<mx:Label text="What do these keys correspond to?"/>
<admin:GeometryCollectionDialog id="geometrySelector"
paddingLeft="{paddingIndent}"
- keyType="{dataTableNameInput.asTextInput().text}"/>
+ defaultKeyType="{dataTableNameInput.asTextInput().text}"/>
<mx:CheckBox id="secondaryKeyColumnCheckBox" label="Format data for Dimension Slider" selected="false"/>
<ui:Indent label="Secondary key column"
@@ -40,7 +40,7 @@
</ui:Indent>
<mx:VBox visible="{keyColumnComboBox.selectedItem}">
<mx:Label text="What do these keys correspond to?"/>
- <admin:GeometryCollectionDialog paddingLeft="{paddingIndent}" id="geometrySelector" keyType="{tableSelector.activeTable}"/>
+ <admin:GeometryCollectionDialog paddingLeft="{paddingIndent}" id="geometrySelector" defaultKeyType="{tableSelector.activeTable}"/>
<mx:CheckBox change="handleKeyColumnChange()" id="secondaryKeyColumnCheckBox" label="Format data for Dimension Slider" selected="false"/>
<ui:Indent paddingLeft="{paddingIndent}"

0 comments on commit e933dd8

Please sign in to comment.