@@ -227,32 +227,36 @@ public CtrCandFormationWindow(final Formation formation, final SecurityCtrCandFo
227
227
228
228
btnApo .addClickListener (e -> {
229
229
final SearchFormationApoWindow window = new SearchFormationApoWindow (ctrCand .getIdCtrCand ());
230
- window .addVetListener (v -> {
231
- if (v .getId () != null && v .getId ().getCodEtpVet () != null && v .getId ().getCodVrsVet () != null ) {
232
- rtfCodEtpVetApo .setValue (v .getId ().getCodEtpVet ());
233
- rtfCodVrsVetApo .setValue (v .getId ().getCodVrsVet ());
234
- final RequiredTextField rtfCodForm = (RequiredTextField ) fieldGroup .getField (Formation_ .codForm .getName ());
235
- rtfCodForm .setValue (v .getId ().getCodEtpVet () + "-" + v .getId ().getCodVrsVet ());
230
+ window .addVetListener ((vet , useCode , useLibelle ) -> {
231
+ if (vet .getId () != null && vet .getId ().getCodEtpVet () != null && vet .getId ().getCodVrsVet () != null ) {
232
+ rtfCodEtpVetApo .setValue (vet .getId ().getCodEtpVet ());
233
+ rtfCodVrsVetApo .setValue (vet .getId ().getCodVrsVet ());
234
+ if (useCode ) {
235
+ final RequiredTextField rtfCodForm = (RequiredTextField ) fieldGroup .getField (Formation_ .codForm .getName ());
236
+ rtfCodForm .setValue (vet .getId ().getCodEtpVet () + "-" + vet .getId ().getCodVrsVet ());
237
+ }
236
238
237
239
/* Initialisation du diplome */
238
240
rtfCodDipApo .setValue (null );
239
241
rtfCodVrsDdiApo .setValue (null );
240
242
rtfLibDipApoo .setValue (null );
241
243
}
242
- if (v .getLibVet () != null ) {
243
- rtfLibApo .setValue (v .getLibVet ());
244
- final RequiredTextField rtfLibForm = (RequiredTextField ) fieldGroup .getField (Formation_ .libForm .getName ());
245
- rtfLibForm .setValue (v .getLibVet ());
244
+ if (vet .getLibVet () != null ) {
245
+ rtfLibApo .setValue (vet .getLibVet ());
246
+ if (useLibelle ) {
247
+ final RequiredTextField rtfLibForm = (RequiredTextField ) fieldGroup .getField (Formation_ .libForm .getName ());
248
+ rtfLibForm .setValue (vet .getLibVet ());
249
+ }
246
250
}
247
251
248
- if (v .getId ().getCodCge () != null ) {
252
+ if (vet .getId ().getCodCge () != null ) {
249
253
final RequiredComboBox <SiScolCentreGestion > comboBoxCGE = (RequiredComboBox <SiScolCentreGestion >) fieldGroup .getField (Formation_ .siScolCentreGestion .getName ());
250
- comboBoxCGE .setValue (tableRefController .getSiScolCentreGestionByCode (v .getId ().getCodCge ()));
254
+ comboBoxCGE .setValue (tableRefController .getSiScolCentreGestionByCode (vet .getId ().getCodCge ()));
251
255
comboBoxCGE .setEnabled (false );
252
256
}
253
- if (v .getId ().getCodTpd () != null ) {
257
+ if (vet .getId ().getCodTpd () != null ) {
254
258
final RequiredComboBox <TypDiplome > comboBoxTd = (RequiredComboBox <TypDiplome >) fieldGroup .getField (Formation_ .siScolTypDiplome .getName ());
255
- comboBoxTd .setValue (tableRefController .getSiScolTypDiplomeByCode (v .getId ().getCodTpd ()));
259
+ comboBoxTd .setValue (tableRefController .getSiScolTypDiplomeByCode (vet .getId ().getCodTpd ()));
256
260
comboBoxTd .setEnabled (false );
257
261
}
258
262
majFieldDip ();
@@ -337,17 +341,20 @@ public CtrCandFormationWindow(final Formation formation, final SecurityCtrCandFo
337
341
338
342
btnPegase .addClickListener (e -> {
339
343
final SearchFormationPegaseWindow window = new SearchFormationPegaseWindow ();
340
- window .addFormationListener (form -> {
344
+ window .addFormationListener (( form , useCode , useLibelle ) -> {
341
345
if (form .getCode () != null ) {
342
346
rtfCodFormPegase .setValue (form .getCode ());
343
- final RequiredTextField rtfCodForm = (RequiredTextField ) fieldGroup .getField (Formation_ .codForm .getName ());
344
- rtfCodForm .setValue (form .getCode ());
345
-
347
+ if (useCode ) {
348
+ final RequiredTextField rtfCodForm = (RequiredTextField ) fieldGroup .getField (Formation_ .codForm .getName ());
349
+ rtfCodForm .setValue (form .getCode ());
350
+ }
346
351
}
347
352
if (form .getLibelleLong () != null ) {
348
353
rtfLibFormPegase .setValue (form .getLibelleLong ());
349
- final RequiredTextField rtfLibForm = (RequiredTextField ) fieldGroup .getField (Formation_ .libForm .getName ());
350
- rtfLibForm .setValue (form .getLibelleLong ());
354
+ if (useLibelle ) {
355
+ final RequiredTextField rtfLibForm = (RequiredTextField ) fieldGroup .getField (Formation_ .libForm .getName ());
356
+ rtfLibForm .setValue (form .getLibelleLong ());
357
+ }
351
358
}
352
359
353
360
// if (form.getCodeStructure() != null) {
0 commit comments