Index: branches/v2_0_0_prep/extensions/org.gvsig.daltransform.app.mainplugin/src/main/java/org/gvsig/daltransform/swing/impl/DefaultDataTransformWizard.java
===================================================================
--- branches/v2_0_0_prep/extensions/org.gvsig.daltransform.app.mainplugin/src/main/java/org/gvsig/daltransform/swing/impl/DefaultDataTransformWizard.java	(revision 38551)
+++ branches/v2_0_0_prep/extensions/org.gvsig.daltransform.app.mainplugin/src/main/java/org/gvsig/daltransform/swing/impl/DefaultDataTransformWizard.java	(revision 38552)
@@ -71,7 +71,10 @@
     }
 
     private void initialize() {
+        
         getWizardComponents().getFinishButton().setEnabled(false);
+        getWizardComponents().getBackButton().setEnabled(false);
+        
         getWindowInfo().setTitle(
             PluginServices.getText(this, "transform_wizard"));
         addDataTransformWizardPanel(selectTransformWizardPanel);
Index: branches/v2_0_0_prep/extensions/org.gvsig.daltransform.app.mainplugin/src/main/java/org/gvsig/daltransform/swing/impl/components/FeatureTypeAttributesCombo.java
===================================================================
--- branches/v2_0_0_prep/extensions/org.gvsig.daltransform.app.mainplugin/src/main/java/org/gvsig/daltransform/swing/impl/components/FeatureTypeAttributesCombo.java	(revision 38551)
+++ branches/v2_0_0_prep/extensions/org.gvsig.daltransform.app.mainplugin/src/main/java/org/gvsig/daltransform/swing/impl/components/FeatureTypeAttributesCombo.java	(revision 38552)
@@ -27,6 +27,8 @@
  
 package org.gvsig.daltransform.swing.impl.components;
 
+import java.util.ArrayList;
+
 import javax.swing.DefaultComboBoxModel;
 import javax.swing.JComboBox;
 
@@ -52,24 +54,83 @@
 		this.setModel(new DefaultComboBoxModel());
 	}
 
-	public void addFeatureAttrubutes(FeatureStore featureStore) throws DataException{
-		addFeatureAttributes(featureStore.getDefaultFeatureType());
+	/**
+	 * Removes all items then adds atts
+	 * 
+	 * @param featureStore
+	 * @return the number of items added (equals total item count)
+	 * 
+	 * @throws DataException
+	 */
+	public int addFeatureAttrubutes(FeatureStore featureStore) throws DataException{
+		return addFeatureAttributes(featureStore.getDefaultFeatureType());
 	}
 	
-	public void addFeatureAttributes(FeatureType featureType){
+	/**
+	 * Removes all items then adds atts
+	 * 
+	 * @param featureType
+	 * @return the number of items added (equals total item count)
+	 */
+	public int addFeatureAttributes(FeatureType featureType){
 		removeAllItems();
 		FeatureAttributeDescriptor[] descriptors = featureType.getAttributeDescriptors();
 		for (int i=0 ; i<descriptors.length ; i++){
 			addFeatureAttributeDescriptor(descriptors[i]);						
 		}		
+		return descriptors.length;
 	}
 
-	public void addFeatureAttributeDescriptor(FeatureAttributeDescriptor featureAttributeDescriptor){
+
+	/**
+	 * Removes all items then adds atts whose type is
+	 * contained by list
+	 * 
+	 * @param featureType
+	 * @param type
+	 * @return the number of items added (equals total item count)
+	 */
+	public int addFeatureAttributes(
+	    FeatureType featureType,
+	    ArrayList<Integer> types){
+	    
+	    removeAllItems();
+	    
+	    int count = 0;
+	    FeatureAttributeDescriptor[] descriptors = featureType.getAttributeDescriptors();
+	    for (int i=0 ; i<descriptors.length ; i++){
+	        if (isIn(descriptors[i].getType(), types)) {
+	            addFeatureAttributeDescriptor(descriptors[i]);  
+	            count++;
+	        }
+	    }     
+	    return count;
+	}
+
+	/**
+     * @param type
+     * @param types
+     * @return
+     */
+    private boolean isIn(int t, ArrayList<Integer> list) {
+        
+        int len = list.size();
+        for (int i=0; i<len; i++) {
+            if (list.get(i).intValue() == t) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    public void addFeatureAttributeDescriptor(FeatureAttributeDescriptor featureAttributeDescriptor){
 		((DefaultComboBoxModel)getModel()).addElement(new FeatureTypeAttributeWrapper(featureAttributeDescriptor));
 	}
 		
 	public FeatureAttributeDescriptor getSelectedFeatureAttributeDescriptor(){
 		return ((FeatureTypeAttributeWrapper)getSelectedItem()).getFeatureAttributeDescriptor();
 	}	
+	
+
 }
 
Index: branches/v2_0_0_prep/extensions/extDalTransformJoin/src/org/gvsig/app/join/daltransform/SelectParametersWizardPanel.java
===================================================================
--- branches/v2_0_0_prep/extensions/extDalTransformJoin/src/org/gvsig/app/join/daltransform/SelectParametersWizardPanel.java	(revision 38551)
+++ branches/v2_0_0_prep/extensions/extDalTransformJoin/src/org/gvsig/app/join/daltransform/SelectParametersWizardPanel.java	(revision 38552)
@@ -27,30 +27,51 @@
 
 package org.gvsig.app.join.daltransform;
 
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.ArrayList;
+
+import javax.swing.JOptionPane;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import org.gvsig.andami.PluginServices;
+import org.gvsig.app.ApplicationLocator;
+import org.gvsig.app.join.utils.TransformUtils;
 import org.gvsig.daltransform.swing.DataTransformWizardPanel;
 import org.gvsig.daltransform.swing.impl.AbstractDataTransformWizardPanel;
 import org.gvsig.daltransform.swing.impl.components.FeatureTypeAttributesCombo;
 import org.gvsig.daltransform.swing.impl.components.FeatureTypeAttributesList;
 import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor;
 import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.dal.feature.FeatureType;
+import org.gvsig.i18n.Messages;
 
 
 /**
  * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a>
  */
-public class SelectParametersWizardPanel extends AbstractDataTransformWizardPanel implements DataTransformWizardPanel{
+public class SelectParametersWizardPanel extends AbstractDataTransformWizardPanel
+implements DataTransformWizardPanel, ActionListener{
+    
+    private static Logger logger =
+        LoggerFactory.getLogger(SelectParametersWizardPanel.class);
+    
 	private javax.swing.JLabel attributesLabel;
 	private FeatureTypeAttributesList attributesList;
 	private javax.swing.JScrollPane attributesScroll;
 	private FeatureTypeAttributesCombo key1Combo;
 	private javax.swing.JLabel key1Label;
-	private FeatureTypeAttributesCombo key2Combo;
+	private FeatureTypeAttributesCombo key2_Combo;
 	private javax.swing.JLabel key2Label;
 	private javax.swing.JLabel prefix1Label;
 	private javax.swing.JTextField prefix1Text;
 	private javax.swing.JLabel prefix2Label;
 	private javax.swing.JTextField prefix2Text; 
+	
+	private FeatureStore secondFeatStore = null;
 
 	/**
 	 * @param featureTransformWizardModel
@@ -73,10 +94,16 @@
 		java.awt.GridBagConstraints gridBagConstraints;
 
 		prefix2Text = new javax.swing.JTextField();
-		key2Combo = new FeatureTypeAttributesCombo();
+		key2_Combo = new FeatureTypeAttributesCombo();
 		prefix1Text = new javax.swing.JTextField();
 		key1Label = new javax.swing.JLabel();
+		
 		key1Combo = new FeatureTypeAttributesCombo();
+		// listen to changes in first combo
+		// we'll update second combo leaving
+		// fields of same type
+		key1Combo.addActionListener(this);
+		
 		key2Label = new javax.swing.JLabel();
 		prefix1Label = new javax.swing.JLabel();
 		prefix2Label = new javax.swing.JLabel();
@@ -99,7 +126,7 @@
 		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
 		gridBagConstraints.weightx = 1.0;
 		gridBagConstraints.insets = new java.awt.Insets(2, 2, 3, 2);
-		add(key2Combo, gridBagConstraints);
+		add(key2_Combo, gridBagConstraints);
 		gridBagConstraints = new java.awt.GridBagConstraints();
 		gridBagConstraints.gridx = 0;
 		gridBagConstraints.gridy = 5;
@@ -179,7 +206,7 @@
 	 * @return
 	 */
 	public String getkeyAtrr2() {
-		return key2Combo.getSelectedFeatureAttributeDescriptor().getName();
+		return key2_Combo.getSelectedFeatureAttributeDescriptor().getName();
 	}
 
 	/**
@@ -208,9 +235,77 @@
 	 * @throws DataException 
 	 */
 	public void updateFeatureStores(FeatureStore selectedFeatureStore) throws DataException {
+	    secondFeatStore = selectedFeatureStore;
 		key1Combo.addFeatureAttributes(getFeatureStore().getDefaultFeatureType());
-		key2Combo.addFeatureAttributes(selectedFeatureStore.getDefaultFeatureType());
 		attributesList.addFeatureAttributes(selectedFeatureStore.getDefaultFeatureType());
+		
+		if (key1Combo.getItemCount() == 0) {
+		    
+            String _msg =
+                Messages.getText("_First_table_has_no_fields");
+            String _tit = Messages.getText("_Join");
+            
+            JOptionPane.showMessageDialog(
+                this, _msg, _tit,
+                JOptionPane.ERROR_MESSAGE);
+            
+		    getDataTransformWizard().setApplicable(false);
+        } else {
+            key1Combo.setSelectedIndex(0);
+		}
 	}
+
+
+	/**
+	 * Listen to changes in first combo box (key1)
+	 */
+    public void actionPerformed(ActionEvent e) {
+        
+        Object src = e.getSource();
+        if (src == key1Combo
+            && key1Combo != null
+            && key2_Combo != null
+            && secondFeatStore != null) {
+            
+            FeatureAttributeDescriptor att =
+                key1Combo.getSelectedFeatureAttributeDescriptor();
+            if (att != null) {
+                
+                int the_type = att.getType();
+                key2_Combo.removeAllItems();
+                FeatureType ft = null;
+                
+                try {
+                    ft = secondFeatStore.getDefaultFeatureType();
+                } catch (DataException de) {
+                    logger.info("While getting feat type: " + de.getMessage());
+                    getDataTransformWizard().setApplicable(false);
+                    ApplicationLocator.getManager().message(
+                        Messages.getText("_Error_getting_attributes"),
+                        JOptionPane.ERROR_MESSAGE);
+                    return;
+                }
+                
+                ArrayList<Integer> comparable_types =
+                    TransformUtils.getComparableDataTypes(ft, the_type);
+                
+                if (key2_Combo.addFeatureAttributes(ft, comparable_types) == 0) {
+                    getDataTransformWizard().setApplicable(false);
+                    
+                    String _msg =
+                        Messages.getText("_No_compatible_field_in_second_table");
+                    String _tit = Messages.getText("_Join");
+                    
+                    JOptionPane.showMessageDialog(
+                        this, _msg, _tit,
+                        JOptionPane.ERROR_MESSAGE);
+                } else {
+                    getDataTransformWizard().setApplicable(true);
+                    // JOptionPane.showMessageDialog(this, "(2) OK !!");
+                }
+            }
+        }
+        
+    }
 }
 
Index: branches/v2_0_0_prep/extensions/extDalTransformJoin/src/org/gvsig/app/join/utils/TransformUtils.java
===================================================================
--- branches/v2_0_0_prep/extensions/extDalTransformJoin/src/org/gvsig/app/join/utils/TransformUtils.java	(revision 0)
+++ branches/v2_0_0_prep/extensions/extDalTransformJoin/src/org/gvsig/app/join/utils/TransformUtils.java	(revision 38552)
@@ -0,0 +1,78 @@
+/* gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright © 2007-2012 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.app.join.utils;
+
+import java.util.ArrayList;
+
+import org.gvsig.fmap.dal.DataTypes;
+import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor;
+import org.gvsig.fmap.dal.feature.FeatureType;
+
+
+/**
+ * {@link DataTypes}-related utility methods
+ * 
+ * @author jldominguez
+ *
+ */
+public class TransformUtils {
+
+    public static boolean isNumericType(int t) {
+        return (t == DataTypes.DOUBLE
+            || t == DataTypes.FLOAT
+            || t == DataTypes.INT
+            || t == DataTypes.LONG
+            || t == DataTypes.BYTE);
+    }
+    
+    public static boolean comparableTypes(int a, int b) {
+        
+        if (a == b) {
+            return true;
+        } else {
+            return isNumericType(a) && isNumericType(b);
+        }
+        
+    }
+    /**
+     * @param ft
+     * @param the_type
+     * @return
+     */
+    public static ArrayList<Integer> getComparableDataTypes(
+        FeatureType ft,
+        int the_type) {
+
+        ArrayList<Integer> resp = new ArrayList<Integer>();
+        
+        FeatureAttributeDescriptor[] atts = ft.getAttributeDescriptors();
+        int len = atts.length;
+        for (int i=0; i<len; i++) {
+            if (comparableTypes(the_type, atts[i].getType())) {
+                resp.add(atts[i].getType());
+            }
+        }
+        return resp;
+    }
+
+}
Index: branches/v2_0_0_prep/extensions/extDalTransformJoin/resources/org/gvsig/app/join/i18n/text.properties
===================================================================
--- branches/v2_0_0_prep/extensions/extDalTransformJoin/resources/org/gvsig/app/join/i18n/text.properties	(revision 38551)
+++ branches/v2_0_0_prep/extensions/extDalTransformJoin/resources/org/gvsig/app/join/i18n/text.properties	(revision 38552)
@@ -5,4 +5,8 @@
 join_first_prefix=Escriba el prefijo de la primera tabla
 join_second_prefix=Escriba el prefijo de la segunda tabla
 join_select_attributes=Selecciona los atributos a unir
-_Unable_to_refresh_table_contents=No se ha podido actualizar la tabla 
+_Unable_to_refresh_table_contents=No se ha podido actualizar la tabla
+_First_table_has_no_fields=La primera tabla no tiene campos
+_Join=Unión de tablas
+_Error_getting_attributes=Error al obtener campos
+_No_compatible_field_in_second_table=No hay campos compatibles en la segunda tabla
\ No newline at end of file
Index: branches/v2_0_0_prep/extensions/extDalTransformJoin/resources/org/gvsig/app/join/i18n/text_en.properties
===================================================================
--- branches/v2_0_0_prep/extensions/extDalTransformJoin/resources/org/gvsig/app/join/i18n/text_en.properties	(revision 38551)
+++ branches/v2_0_0_prep/extensions/extDalTransformJoin/resources/org/gvsig/app/join/i18n/text_en.properties	(revision 38552)
@@ -6,3 +6,7 @@
 join_second_prefix=Type a prefix for the second table
 join_select_attributes=Select the attributes to join
 _Unable_to_refresh_table_contents=Unable to refresh table contents
+_First_table_has_no_fields=First table has no fields
+_Join=Join
+_Error_getting_attributes=Error getting attributes
+_No_compatible_field_in_second_table=No compatible fields in second table
