alejandro-du / crudui

Automatically generate CRUD-like Vaadin views for any Java Bean
https://vaadin.com/directory#!addon/crud-ui-add-on
Apache License 2.0
86 stars 54 forks source link

Permit set delete caption #40

Closed adexerivera closed 5 years ago

adexerivera commented 5 years ago

There is no option to change the alert message on delete operation, "Are you sure you want to delete this item?" as in the case of the rest of messages.

Would it be possible to access this message to update it?

alejandro-du commented 5 years ago

You can use the AbstractTwoComponentsCrudLayout::setFormCaption or WindowBasedCrudLayout::setWindowCaption` methods to accomplish this.

adexerivera commented 5 years ago

Great @alejandro-du

I was trying to make use of some of the functions that the add-on already has available, such as the setValidationErrorMessage.

Through your response I managed to solve the problem, here there are the code that solves it to me in case it could be useful to someone else.

HorizontalSplitCrudLayout crudLayout = new HorizontalSplitCrudLayout();
crudLayout.setFormCaption(CrudOperation.DELETE,"¿Estás segur@ que quieres eliminar este elemento?");
GridCrud<Certification> crud = new GridCrud<>(Certification.class, crudLayout);

Thanks