| Line 336... |
Line 336... |
| 336 |
if (relationCollectionACommentaire != null) {
|
336 |
if (relationCollectionACommentaire != null) {
|
| 337 |
// Ajout de la personne supprimée à la liste
|
337 |
// Ajout de la personne supprimée à la liste
|
| 338 |
if ((relationCollectionACommentaire.get("_etat_").equals("") || !relationCollectionACommentaire.get("_etat_").equals(aDonnee.ETAT_AJOUTE))
|
338 |
if ((relationCollectionACommentaire.get("_etat_").equals("") || !relationCollectionACommentaire.get("_etat_").equals(aDonnee.ETAT_AJOUTE))
|
| 339 |
&& relationCollectionACommentaire.getId() != null
|
339 |
&& relationCollectionACommentaire.getId() != null
|
| 340 |
&& !relationCollectionACommentaire.getId().equals("")) {
|
340 |
&& !relationCollectionACommentaire.getId().equals("")) {
|
| 341 |
Debug.log("Nbre commentaires supprimées avant:"+commentairesSupprimes.size());
|
- |
|
| 342 |
commentairesSupprimes.put("id"+idGenere++, relationCollectionACommentaire);
|
341 |
commentairesSupprimes.put("id"+idGenere++, relationCollectionACommentaire);
|
| 343 |
Debug.log("Commentaires supprimées : "+relationCollectionACommentaire.getCommentaire().getId());
|
- |
|
| 344 |
Debug.log("Nbre commentaires supprimées :"+commentairesSupprimes.size());
|
- |
|
| 345 |
}
|
342 |
}
|
| Line 346... |
Line 343... |
| 346 |
|
343 |
|
| 347 |
// Suppression de l'enregistrement de la grille
|
344 |
// Suppression de l'enregistrement de la grille
|
| 348 |
grille.getStore().remove(relationCollectionACommentaire);
|
345 |
grille.getStore().remove(relationCollectionACommentaire);
|
| Line 362... |
Line 359... |
| 362 |
}
|
359 |
}
|
| 363 |
});
|
360 |
});
|
| 364 |
storeGrille.addListener(Store.Update, new Listener<StoreEvent<CollectionACommentaire>>() {
|
361 |
storeGrille.addListener(Store.Update, new Listener<StoreEvent<CollectionACommentaire>>() {
|
| 365 |
public void handleEvent(StoreEvent<CollectionACommentaire> ce) {
|
362 |
public void handleEvent(StoreEvent<CollectionACommentaire> ce) {
|
| 366 |
if (ce.getRecord().isModified("_type_") && !ce.getModel().get("_etat_").equals(aDonnee.ETAT_AJOUTE)) {
|
363 |
if (ce.getRecord().isModified("_type_") && !ce.getModel().get("_etat_").equals(aDonnee.ETAT_AJOUTE)) {
|
| 367 |
Debug.log("id type modifié : "+ce.getModel().get("_type_"));
|
- |
|
| 368 |
ce.getModel().set("_etat_", aDonnee.ETAT_MODIFIE);
|
364 |
ce.getModel().set("_etat_", aDonnee.ETAT_MODIFIE);
|
| 369 |
}
|
365 |
}
|
| 370 |
}
|
366 |
}
|
| 371 |
});
|
367 |
});
|
| Line 422... |
Line 418... |
| 422 |
public Object postProcessValue(Object valeur) {
|
418 |
public Object postProcessValue(Object valeur) {
|
| 423 |
String retour = null;
|
419 |
String retour = null;
|
| 424 |
if (getField().getRawValue() != null ) {
|
420 |
if (getField().getRawValue() != null ) {
|
| 425 |
retour = getField().getRawValue();
|
421 |
retour = getField().getRawValue();
|
| 426 |
}
|
422 |
}
|
| 427 |
Debug.log("Post : "+retour);
|
- |
|
| 428 |
return retour;
|
423 |
return retour;
|
| 429 |
}
|
424 |
}
|
| 430 |
};
|
425 |
};
|
| Line 431... |
Line 426... |
| 431 |
|
426 |
|
| 432 |
GridCellRenderer<CollectionACommentaire> typeRendu = new GridCellRenderer<CollectionACommentaire>() {
|
427 |
GridCellRenderer<CollectionACommentaire> typeRendu = new GridCellRenderer<CollectionACommentaire>() {
|
| 433 |
public String render(CollectionACommentaire model, String property, ColumnData config, int rowIndex, int colIndex, ListStore<CollectionACommentaire> store, Grid<CollectionACommentaire> grid) {
|
428 |
public String render(CollectionACommentaire model, String property, ColumnData config, int rowIndex, int colIndex, ListStore<CollectionACommentaire> store, Grid<CollectionACommentaire> grid) {
|
| 434 |
String type = model.get("_type_");
|
- |
|
| 435 |
Debug.log("Initialisation type origine :"+type);
|
429 |
String type = model.get("_type_");
|
| 436 |
if (typeCombo.getStore() != null && type != null && (type.matches("[0-9]+") || type.contains(aDonnee.SEPARATEUR_VALEURS))) {
|
430 |
if (typeCombo.getStore() != null && type != null && (type.matches("[0-9]+") || type.contains(aDonnee.SEPARATEUR_VALEURS))) {
|
| 437 |
type = typeCombo.formaterIdentifiantsEnTexte(type);
|
431 |
type = typeCombo.formaterIdentifiantsEnTexte(type);
|
| 438 |
model.set("_type_", type);
|
- |
|
| 439 |
Debug.log("Initialisation :"+type);
|
432 |
model.set("_type_", type);
|
| 440 |
}
|
433 |
}
|
| 441 |
return type;
|
434 |
return type;
|
| 442 |
}
|
435 |
}
|
| 443 |
};
|
436 |
};
|
| Line 575... |
Line 568... |
| 575 |
CollectionACommentaire relationCollectionACommentaire = grille.getStore().getAt(i);
|
568 |
CollectionACommentaire relationCollectionACommentaire = grille.getStore().getAt(i);
|
| 576 |
if (relationCollectionACommentaire.get("_etat_") != null) {
|
569 |
if (relationCollectionACommentaire.get("_etat_") != null) {
|
| 577 |
if (relationCollectionACommentaire.get("_etat_").equals(aDonnee.ETAT_MODIFIE)) {
|
570 |
if (relationCollectionACommentaire.get("_etat_").equals(aDonnee.ETAT_MODIFIE)) {
|
| 578 |
corrigerChampsGrille(relationCollectionACommentaire);// Nous modifions l'id_type
|
571 |
corrigerChampsGrille(relationCollectionACommentaire);// Nous modifions l'id_type
|
| 579 |
commentairesModifies.put("id"+idGenere++, relationCollectionACommentaire);
|
572 |
commentairesModifies.put("id"+idGenere++, relationCollectionACommentaire);
|
| 580 |
Debug.log("Commentaires modifiés : "+relationCollectionACommentaire.getCommentaire().getTitre());
|
- |
|
| 581 |
}
|
573 |
}
|
| 582 |
if (relationCollectionACommentaire.get("_etat_").equals(aDonnee.ETAT_AJOUTE)) {
|
574 |
if (relationCollectionACommentaire.get("_etat_").equals(aDonnee.ETAT_AJOUTE)) {
|
| 583 |
corrigerChampsGrille(relationCollectionACommentaire);// Nous modifions l'id_type
|
575 |
corrigerChampsGrille(relationCollectionACommentaire);// Nous modifions l'id_type
|
| 584 |
commentairesAjoutes.put("id"+idGenere++, relationCollectionACommentaire);
|
576 |
commentairesAjoutes.put("id"+idGenere++, relationCollectionACommentaire);
|
| 585 |
Debug.log("Commentaires ajoutés : "+relationCollectionACommentaire.getCommentaire().getTitre());
|
- |
|
| 586 |
}
|
577 |
}
|
| 587 |
// Initialisation de la grille
|
578 |
// Initialisation de la grille
|
| 588 |
relationCollectionACommentaire.set("_etat_", "");
|
579 |
relationCollectionACommentaire.set("_etat_", "");
|
| 589 |
}
|
580 |
}
|
| 590 |
}
|
581 |
}
|