275 |
275 |
}
|
276 |
276 |
}
|
277 |
277 |
}
|
|
278 |
callUserEvent("form_beforeFirst", this.getForm());
|
278 |
279 |
this.current = 0;
|
279 |
280 |
this.form.setValues((DynObject) this.values.get(this.current));
|
280 |
281 |
this.buttonBar.setCurrent(this.current);
|
... | ... | |
286 |
287 |
} catch (Exception ex) {
|
287 |
288 |
LOGGER.warn("Can't enable/disable delete and save buttons",ex);
|
288 |
289 |
}
|
|
290 |
callUserEvent("form_afterFirst", this.getForm());
|
289 |
291 |
this.fireFormMovedToEvent(this.current);
|
290 |
292 |
return true;
|
291 |
293 |
}
|
... | ... | |
303 |
305 |
}
|
304 |
306 |
}
|
305 |
307 |
}
|
|
308 |
callUserEvent("form_beforePrevious", this.getForm());
|
306 |
309 |
if (this.current > 0) {
|
307 |
310 |
this.current--;
|
308 |
311 |
}
|
309 |
312 |
this.form.setValues((DynObject) this.values.get(this.current));
|
310 |
313 |
this.buttonBar.setCurrent(this.current);
|
|
314 |
callUserEvent("form_afterPrevious", this.getForm());
|
311 |
315 |
this.fireFormMovedToEvent(this.current);
|
312 |
316 |
return true;
|
313 |
317 |
}
|
... | ... | |
325 |
329 |
}
|
326 |
330 |
}
|
327 |
331 |
}
|
|
332 |
callUserEvent("form_beforeNext", this.getForm());
|
328 |
333 |
if (this.current < this.values.size() - 1) {
|
329 |
334 |
this.current++;
|
330 |
335 |
}
|
331 |
336 |
this.form.setValues((DynObject) this.values.get(this.current));
|
332 |
337 |
this.buttonBar.setCurrent(this.current);
|
|
338 |
callUserEvent("form_afterNext", this.getForm());
|
333 |
339 |
this.fireFormMovedToEvent(this.current);
|
334 |
340 |
return true;
|
335 |
341 |
}
|
... | ... | |
347 |
353 |
}
|
348 |
354 |
}
|
349 |
355 |
}
|
|
356 |
callUserEvent("form_beforeLast", this.getForm());
|
350 |
357 |
this.current = this.values.size() - 1;
|
351 |
358 |
this.form.setValues((DynObject) this.values.get(this.current));
|
352 |
359 |
this.buttonBar.setCurrent(this.current);
|
|
360 |
callUserEvent("form_afterLast", this.getForm());
|
353 |
361 |
this.fireFormMovedToEvent(this.current);
|
354 |
362 |
return true;
|
355 |
363 |
}
|
... | ... | |
372 |
380 |
LOGGER.warn("Can't notify to listeners before save.",e);
|
373 |
381 |
return false;
|
374 |
382 |
}
|
|
383 |
callUserEvent("form_beforeSave", this.getForm());
|
375 |
384 |
|
376 |
385 |
List<String> fieldsName = new ArrayList<>();
|
377 |
386 |
if (!this.form.hasValidValues(fieldsName)) {
|
... | ... | |
398 |
407 |
}
|
399 |
408 |
|
400 |
409 |
this.leaveTheNewState();
|
|
410 |
callUserEvent("form_afterSave", this.getForm());
|
401 |
411 |
|
402 |
412 |
try {
|
403 |
413 |
this.listeners.accept(new Visitor() {
|
... | ... | |
427 |
437 |
} catch (BaseException e) {
|
428 |
438 |
return true;
|
429 |
439 |
}
|
|
440 |
callUserEvent("form_beforeNew", this.getForm());
|
430 |
441 |
this.enterStateNew();
|
|
442 |
callUserEvent("form_afterNew", this.getForm());
|
431 |
443 |
try {
|
432 |
444 |
this.listeners.accept(new Visitor() {
|
433 |
445 |
@Override
|
... | ... | |
453 |
465 |
} catch (BaseException e) {
|
454 |
466 |
return true;
|
455 |
467 |
}
|
|
468 |
callUserEvent("form_beforeCancelNew", this.getForm());
|
456 |
469 |
this.leaveTheNewState();
|
|
470 |
callUserEvent("form_afterCancelNew", this.getForm());
|
457 |
471 |
try {
|
458 |
472 |
this.listeners.accept(new Visitor() {
|
459 |
473 |
@Override
|
... | ... | |
711 |
725 |
public void fireEvent(String action, Object value) {
|
712 |
726 |
this.getButtonBar().fireEvent(action, value);
|
713 |
727 |
}
|
714 |
|
|
|
728 |
|
715 |
729 |
}
|