@Override
public void onClick(ClickEvent arg0) {
Listener<MessageBoxEvent> callback = new Listener<MessageBoxEvent>() {
@Override
public void handleEvent(MessageBoxEvent be) {
Button btt = be.getButtonClicked();
if (Dialog.OK.equals(btt.getItemId())) {
if (isSave == false) {
saveAction(chantier.getId(), transfertPpId);
isSave = true;
}
}
}
};
createConfirmBox(callback, messages.deleteConfirmTitle(), messages.confirmSupprimer());
}
});
buttonPanel.add(saveButton);
layoutContainer_10.add(buttonPanel, new BorderLayoutData(LayoutRegion.EAST, 320.0f));
layoutContainer_10.setHeight("30");
fsTransfertPp.add(layoutContainer_10);
LayoutContainer layoutContainer_11 = new LayoutContainer();
Label label1 = new Label();
label1.setText("Details des transferts PP:");
Label label2 = new Label();
label2.setText("Total des transferts PP");
fsTransfertPp.add(label2);
fsTransfertPp.add(gridligTotal);
fsTransfertPp.add(new Html("<br/><br/><br/>"));
fsTransfertPp.add(label1);
fsTransfertPp.add(layoutContainer_11);
addFicheST = new HTML("<img src='./images/ajouter.png'/> " + messages.addRow(), false);
addFicheST.setStyleName("actionHTML2");
addFicheST.setVisible(false);
addFicheST.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
showAddDialog();
}
private void showAddDialog() {
Dialog dialog = new Dialog();
dialog.setHeading(messages.titlePopup());
dialog.setLayout(new BorderLayout());
dialog.setWidth(600);
dialog.setHeight(350);
dialog.setBodyBorder(false);
dialog.setHideOnButtonClick(true);
dialog.setButtons(Dialog.OKCANCEL);
dialog.setButtonAlign(HorizontalAlignment.CENTER);
dialog.setScrollMode(Scroll.AUTO);
dialog.setModal(true);
dialog.setBlinkModal(true);
Button cancelButton = dialog.getButtonById(Dialog.CANCEL);
cancelButton.setText(messages.cancel());
Button okButton = dialog.getButtonById(Dialog.OK);
okButton.setText(messages.ok());
final AddTransfertPpForm addTransferPpForm = new AddTransfertPpForm();
dialog.add(addTransferPpForm, new BorderLayoutData(LayoutRegion.CENTER));
okButton.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
LigTransfertppModel model = addTransferPpForm.getDataModel();
gridligModel.getStore().add(model);
isSave = false;
}
});
dialog.show();
}
});
layoutContainer_11.add(gridligModel);
btnRetour = new Button();
btnRetour.setId("btnValider");
btnRetour.setText("Retour");
flexTable = new FlexTable();
addFicheST.setStyleName("actionHTML2");
flexTable.setWidget(0, 0, addFicheST);