<commit_before><?xml version="1.0" encoding="utf-8"?>
<detail:CompositeAttributeRenderer 
				xmlns:fx="http://ns.adobe.com/mxml/2009" 
				xmlns:s="library://ns.adobe.com/flex/spark" 
				xmlns:mx="library://ns.adobe.com/flex/mx" 
				xmlns:input="org.openforis.collect.ui.component.input.*" 
				xmlns:detail="org.openforis.collect.ui.component.detail.*"
				inputFields="{[srsDropDownList, xTextInput, yTextInput]}"
				>
	<fx:Script>
		<![CDATA[
			import org.openforis.collect.Application;
			import org.openforis.collect.i18n.Message;
			import org.openforis.collect.metamodel.proxy.SpatialReferenceSystemProxy;
			
			/*
			override protected function initPresenter():void {
				this.presenter = new CoordinateInputFieldPresenter(this);
			}
			*/
			
			protected function srsLabelFunction(item:Object):String {
				var srs:SpatialReferenceSystemProxy = SpatialReferenceSystemProxy(item);
				return srs.getLabelText();
			}
		]]>
	</fx:Script>

	<detail:states>
		<s:State name="horizontal" />
		<s:State name="vertical" />
	</detail:states>
	
	<s:HGroup includeIn="horizontal" gap="6">
		<input:DropDownInputField id="srsDropDownList" 
								  attributeDefinition="{attributeDefinition}"
								  parentEntity="{parentEntity}"
								  attribute="{attribute}"
								  fieldIndex="2"
								  width="150" 
								  dataField="id"
								  prompt="{Message.get('global.dropDownPrompt')}" 
								  includeIn="horizontal" 
								  itemCreationPolicy="immediate"
								  labelFunction="{srsLabelFunction}"
								  dataProvider="{Application.activeSurvey.spatialReferenceSystems}"
								  />
		<input:NumericInputField id="xTextInput" includeIn="horizontal" itemCreationPolicy="immediate"
								 attributeDefinition="{attributeDefinition}"
								 parentEntity="{parentEntity}"
								 attribute="{attribute}"
								 fieldIndex="0"
								 />
		<input:NumericInputField id="yTextInput" includeIn="horizontal" itemCreationPolicy="immediate" 
								 attributeDefinition="{attributeDefinition}"
								 parentEntity="{parentEntity}"
								 attribute="{attribute}"
								 fieldIndex="1"
								 />
	</s:HGroup>
	
	<s:VGroup includeIn="vertical" gap="2">
		<s:VGroup>
			<s:HGroup gap="0">
				<s:Label width="{subLabelWidth}" styleName="bold" text="{Message.get('edit.coordinate.srs')}"/>
				<fx:Reparent target="srsDropDownList" includeIn="vertical" />
			</s:HGroup>
			<s:HGroup gap="0">
				<s:Label width="{subLabelWidth}" styleName="bold" text="{Message.get('edit.coordinate.x')}"/>
				<fx:Reparent target="xTextInput" includeIn="vertical" />
			</s:HGroup>
			<s:HGroup gap="0">
				<s:Label width="{subLabelWidth}" styleName="bold" text="{Message.get('edit.coordinate.y')}"/>
				<fx:Reparent target="yTextInput" includeIn="vertical" />
			</s:HGroup>
		</s:VGroup>
	</s:VGroup>
	
</detail:CompositeAttributeRenderer>
<commit_msg>OFC-336 Cannot select an empty value from drop down input field (coordinate / srs_id)<commit_after><?xml version="1.0" encoding="utf-8"?>
<detail:CompositeAttributeRenderer 
				xmlns:fx="http://ns.adobe.com/mxml/2009" 
				xmlns:s="library://ns.adobe.com/flex/spark" 
				xmlns:mx="library://ns.adobe.com/flex/mx" 
				xmlns:input="org.openforis.collect.ui.component.input.*" 
				xmlns:detail="org.openforis.collect.ui.component.detail.*"
				inputFields="{[srsDropDownList, xTextInput, yTextInput]}"
				>
	<fx:Script>
		<![CDATA[
			import org.openforis.collect.Application;
			import org.openforis.collect.i18n.Message;
			import org.openforis.collect.metamodel.proxy.SpatialReferenceSystemProxy;
			
			/*
			override protected function initPresenter():void {
				this.presenter = new CoordinateInputFieldPresenter(this);
			}
			*/
			
			protected function srsLabelFunction(item:Object):String {
				if(item != DropDownInputField.EMPTY_SELECTION) {
					var srs:SpatialReferenceSystemProxy = SpatialReferenceSystemProxy(item);
					return srs.getLabelText();
				} else {
					return item.label;
				}
			}
		]]>
	</fx:Script>

	<detail:states>
		<s:State name="horizontal" />
		<s:State name="vertical" />
	</detail:states>
	
	<s:HGroup includeIn="horizontal" gap="6">
		<input:DropDownInputField id="srsDropDownList" 
								  attributeDefinition="{attributeDefinition}"
								  parentEntity="{parentEntity}"
								  attribute="{attribute}"
								  fieldIndex="2"
								  width="150" 
								  dataField="id"
								  includeIn="horizontal" 
								  itemCreationPolicy="immediate"
								  labelFunction="{srsLabelFunction}"
								  dataProvider="{Application.activeSurvey.spatialReferenceSystems}"
								  />
		<input:NumericInputField id="xTextInput" includeIn="horizontal" itemCreationPolicy="immediate"
								 attributeDefinition="{attributeDefinition}"
								 parentEntity="{parentEntity}"
								 attribute="{attribute}"
								 fieldIndex="0"
								 />
		<input:NumericInputField id="yTextInput" includeIn="horizontal" itemCreationPolicy="immediate" 
								 attributeDefinition="{attributeDefinition}"
								 parentEntity="{parentEntity}"
								 attribute="{attribute}"
								 fieldIndex="1"
								 />
	</s:HGroup>
	
	<s:VGroup includeIn="vertical" gap="2">
		<s:VGroup>
			<s:HGroup gap="0">
				<s:Label width="{subLabelWidth}" styleName="bold" text="{Message.get('edit.coordinate.srs')}"/>
				<fx:Reparent target="srsDropDownList" includeIn="vertical" />
			</s:HGroup>
			<s:HGroup gap="0">
				<s:Label width="{subLabelWidth}" styleName="bold" text="{Message.get('edit.coordinate.x')}"/>
				<fx:Reparent target="xTextInput" includeIn="vertical" />
			</s:HGroup>
			<s:HGroup gap="0">
				<s:Label width="{subLabelWidth}" styleName="bold" text="{Message.get('edit.coordinate.y')}"/>
				<fx:Reparent target="yTextInput" includeIn="vertical" />
			</s:HGroup>
		</s:VGroup>
	</s:VGroup>
	
</detail:CompositeAttributeRenderer>

{'fraction_non_alphanumeric': 0.15083056478405316, 'fraction_numerical': 0.007142857142857143, 'mean_word_length': 3.440265486725664, 'pattern_counts': {'":': 0, '<': 65, '<?xml version=': 2, '>': 65, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 14}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1799885', 'n_tokens_mistral': 2496, 'n_tokens_neox': 1849, 'n_words': 241}