Subversion Repositories eFlore/Applications.coel

Rev

Rev 1383 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1383 Rev 1737
Line 7... Line 7...
7
import org.tela_botanica.client.modeles.Valeur;
7
import org.tela_botanica.client.modeles.Valeur;
8
import org.tela_botanica.client.modeles.ValeurListe;
8
import org.tela_botanica.client.modeles.ValeurListe;
9
import org.tela_botanica.client.vues.Formulaire;
9
import org.tela_botanica.client.vues.Formulaire;
Line 10... Line 10...
10
 
10
 
-
 
11
import com.extjs.gxt.ui.client.Registry;
11
import com.extjs.gxt.ui.client.Registry;
12
import com.extjs.gxt.ui.client.Style.SortDir;
12
import com.extjs.gxt.ui.client.store.ListStore;
13
import com.extjs.gxt.ui.client.store.ListStore;
13
import com.extjs.gxt.ui.client.widget.form.ComboBox;
14
import com.extjs.gxt.ui.client.widget.form.ComboBox;
14
import com.extjs.gxt.ui.client.widget.form.Field;
15
import com.extjs.gxt.ui.client.widget.form.Field;
15
import com.extjs.gxt.ui.client.widget.form.Validator;
16
import com.extjs.gxt.ui.client.widget.form.Validator;
Line 105... Line 106...
105
		if (nomChampATrier != null) {
106
		if (nomChampATrier != null) {
106
			champATrier = nomChampATrier;
107
			champATrier = nomChampATrier;
107
		}
108
		}
108
		return champATrier;
109
		return champATrier;
109
	}
110
	}
-
 
111
 
-
 
112
	/**
-
 
113
	 * Définit le nom du champ selon lequel trier, et si trierJusteApres vaut true, trie
-
 
114
	 * @param champATrier
-
 
115
	 */
110
	public void setTrie(String champATrier) {
116
	public void setTrie(String champATrier, boolean trierJusteApres) {
111
		nomChampATrier = champATrier;
117
		nomChampATrier = champATrier;
-
 
118
		if (trierJusteApres) {
-
 
119
			trier();
-
 
120
		}
-
 
121
	}
-
 
122
 
-
 
123
	/**
-
 
124
	 * Définit le nom du champ selon lequel trier, et trie juste après
-
 
125
	 * @param champATrier
-
 
126
	 */
-
 
127
	public void setTrie(String champATrier) {
-
 
128
		setTrie(champATrier, true);
112
	}
129
	}
Line 113... Line 130...
113
	
130
	
114
	public void actualiserValeurParDefaut() {
131
	public void actualiserValeurParDefaut() {
115
		if (valeurDefautId != null && getStore() != null) {
132
		if (valeurDefautId != null && getStore() != null) {
116
			setValue(getStore().findModel("id_valeur", valeurDefautId));
133
			setValue(getStore().findModel("id_valeur", valeurDefautId));
117
		}
134
		}
-
 
135
	}
-
 
136
 
-
 
137
	/**
-
 
138
	 * Trie le contenu de la comboboîte selon le nomChampATrier défini. S'il n'y en a aucun, échoue silencieusement (niark niark)
-
 
139
	 */
-
 
140
	public void trier() {
-
 
141
		if (! this.nomChampATrier.isEmpty()) {
-
 
142
			this.getStore().sort(this.nomChampATrier, SortDir.ASC);
-
 
143
		}
Line 118... Line 144...
118
	}
144
	}
119
	
145
	
120
	public void rafraichir(Object nouvellesDonnees) {
146
	public void rafraichir(Object nouvellesDonnees) {
121
		if (nouvellesDonnees instanceof ValeurListe) {
147
		if (nouvellesDonnees instanceof ValeurListe) {