 	import org.openforis.collect.event.UIEvent;
 	import org.openforis.collect.metamodel.proxy.EntityDefinitionProxy;
 	import org.openforis.collect.metamodel.proxy.ModelVersionProxy;
+	import org.openforis.collect.model.CollectRecord$Step;
 	import org.openforis.collect.model.proxy.RecordProxy;
-	import org.openforis.collect.model.proxy.RecordProxy$Step;
 	import org.openforis.collect.ui.UIBuilder;
 	import org.openforis.collect.ui.component.detail.FormContainer;
 	import org.openforis.collect.ui.view.DetailView;

			_view.keyAttributeValuesText.text = keyValues;
			_view.rootEntityDefinitionText.text = activeRootEntity.getLabelText();
			_view.formVersionText.text = version.getLabelText();
			var submitButtonVisible:Boolean = activeRecord.step == RecordProxy$Step.ENTRY || 
				activeRecord.step == RecordProxy$Step.CLEANSING;
			_view.submitButton.visible = _view.submitButton.includeInLayout = submitButtonVisible;
			
			var rejectButtonVisible:Boolean = activeRecord.step == RecordProxy$Step.CLEANSING || 
				activeRecord.step == RecordProxy$Step.ANALYSIS;
			_view.rejectButton.visible = _view.rejectButton.includeInLayout = rejectButtonVisible;
			
			var form:FormContainer = null;

		protected function rejectButtonClickHandler(event:MouseEvent):void {
			var messageResource:String;
			var r:RecordProxy = Application.activeRecord;
			if(r.step == CollectRecord$Step.CLEANSING) {
				messageResource = "edit.confirmRejectDataCleansing";
			} else if(r.step == CollectRecord$Step.ANALYSIS) {
				messageResource = "edit.confirmRejectDataAnalysis";
			}
			AlertUtil.showConfirm(messageResource, null, null, performReject);
		}
		
		protected function performSubmit():void {
			var responder:AsyncResponder = new AsyncResponder(promoteRecordResultHandler, faultHandler);
			_dataClient.submitRecord(responder, Application.activeRecord.id, Application.activeRecord.step);
		}
		
		protected function performReject():void {
			var responder:AsyncResponder = new AsyncResponder(rejectRecordResultHandler, faultHandler);
			_dataClient.rejectRecord(responder, Application.activeRecord.id, Application.activeRecord.step);
		}
		
		internal function clearActiveRecordHandler(event:ResultEvent, token:Object = null):void {
