Subversion Repositories eFlore/Applications.cel

Rev

Rev 1940 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1940 Rev 2602
Line 5... Line 5...
5
import org.tela_botanica.client.interfaces.Rafraichissable;
5
import org.tela_botanica.client.interfaces.Rafraichissable;
6
import org.tela_botanica.client.modeles.objets.ListeReferentielPerso;
6
import org.tela_botanica.client.modeles.objets.ListeReferentielPerso;
7
import org.tela_botanica.client.modeles.objets.ListeReferentielPerso.TypesReferentiels;
7
import org.tela_botanica.client.modeles.objets.ListeReferentielPerso.TypesReferentiels;
8
import org.tela_botanica.client.observation.ObservationMediateur;
8
import org.tela_botanica.client.observation.ObservationMediateur;
Line -... Line 9...
-
 
9
 
9
 
10
import com.google.gwt.user.client.Window;
10
import com.gwtext.client.core.EventCallback;
11
import com.gwtext.client.core.EventCallback;
11
import com.gwtext.client.core.EventObject;
12
import com.gwtext.client.core.EventObject;
12
import com.gwtext.client.core.ListenerConfig;
13
import com.gwtext.client.core.ListenerConfig;
13
import com.gwtext.client.data.ArrayReader;
14
import com.gwtext.client.data.ArrayReader;
Line 16... Line 17...
16
import com.gwtext.client.data.Record;
17
import com.gwtext.client.data.Record;
17
import com.gwtext.client.data.RecordDef;
18
import com.gwtext.client.data.RecordDef;
18
import com.gwtext.client.data.Store;
19
import com.gwtext.client.data.Store;
19
import com.gwtext.client.data.StringFieldDef;
20
import com.gwtext.client.data.StringFieldDef;
20
import com.gwtext.client.widgets.form.ComboBox;
21
import com.gwtext.client.widgets.form.ComboBox;
-
 
22
import com.gwtext.client.widgets.form.Field;
21
import com.gwtext.client.widgets.form.event.ComboBoxListenerAdapter;
23
import com.gwtext.client.widgets.form.event.ComboBoxListenerAdapter;
Line 22... Line 24...
22
 
24
 
Line 23... Line 25...
23
public abstract class AutoCompletionRefComboBox extends ComboBox implements Rafraichissable {
25
public abstract class AutoCompletionRefComboBox extends ComboBox implements Rafraichissable {
Line 43... Line 45...
43
	private ObservationMediateur oMediateur = null;
45
	private ObservationMediateur oMediateur = null;
44
	private TypesReferentiels typeRef = null;
46
	private TypesReferentiels typeRef = null;
45
	private boolean selectionValeur = false;
47
	private boolean selectionValeur = false;
46
	private boolean estModifie = false;
48
	private boolean estModifie = false;
Line -... Line 49...
-
 
49
	
-
 
50
	private Record rdSelectionne = null;
-
 
51
	private String valeurBrute = null;
47
	
52
	
Line 48... Line 53...
48
	final String resultTplRefPerso = "<div class=\"search-item-ref\">{element_referentiel}</div>";  
53
	final String resultTplRefPerso = "<div class=\"search-item-ref\">{element_referentiel}</div>";  
Line 49... Line 54...
49
	
54
	
Line 92... Line 97...
92
				
97
				
93
  	    	    case KEY_ENTER:	
98
  	    	    case KEY_ENTER:	
94
  	    	    	if (selectionValeur) {
99
  	    	    	if (selectionValeur) {
95
  	    	    		estModifie= true;
100
  	    	    		estModifie= true;
-
 
101
  	    	    		selectionValeur=false;
-
 
102
  	    	    		if(rdSelectionne != null) {
-
 
103
  	    	    			Window.alert("ergregegegegergre");
-
 
104
  	    	    			setRawValue(rdSelectionne.getAsString("element_referentiel"));
96
  	    	    		selectionValeur=false;
105
  	    	    		}
97
  	    	    		onModificationValeur();
106
  	    	    		onModificationValeur();
98
   	    	    	}
107
   	    	    	}
99
   	    	    	else {
108
   	    	    	else {
100
  	    	    		onValidationSaisie();
109
  	    	    		onValidationSaisie();
Line 111... Line 120...
111
		
120
		
112
		
121
		
113
		// Listener completion 
122
		// Listener completion 
114
		addListener(new ComboBoxListenerAdapter() {  
123
		addListener(new ComboBoxListenerAdapter() {  
115
             @Override
124
             @Override
-
 
125
			public void onSelect(ComboBox comboBox, Record record, int index) { 
-
 
126
            	 Window.alert(rdSelectionne.getAsString("element_referentiel")+" "+getRawValue());
116
			public void onSelect(ComboBox comboBox, Record record, int index) {  
127
            	 valeurBrute = getRawValue();
117
            	 setValue(record.getAsString("element_referentiel"));
128
            	 rdSelectionne = record;
118
            	 selectionValeur=true;
129
            	 selectionValeur=true;
-
 
130
                 collapse();
-
 
131
             } 
-
 
132
             
-
 
133
            @Override
-
 
134
			public void onBlur(Field field) {  
-
 
135
            	/*if(rdSelectionne == null || rdSelectionne.getAsString("element_referentiel").equals(getRawValue())) {
-
 
136
            		setValue(getRawValue());
119
                 collapse();
137
            	}*/
120
             }  
-
 
121
         });
138
            }
Line 122... Line 139...
122
		
139
         });
123
	}
140
	}
124
 
141