I bought your “Practical Vaadin” book and came across this plugin. Great!
I just wonder if there is a way to customize (translate) the label/button texts in the Delete-Dialog (e.g. “Are you sure you want to delete this item?”, “Yes, delete”, “Cancel”) and in the Add-Dialog.
Best Regards and thanks for your work!
Hey thanks for the feedback. Yes, it is possible:
crudLayout.setFormCaption(CrudOperation.DELETE, "Are you deleting this for reals?");
OK, I see, but it’s not part of the CrudLayout Interface, so one would have to cast the object depending on the actual configuration:
((AbstractTwoComponentsCrudLayout)
crud.getCrudLayout()).setFormCaption(
CrudOperation.DELETE, "Are you deleting this for real?");
or
((WindowBasedCrudLayout)
crud.getCrudLayout()).setWindowCaption(
CrudOperation.DELETE, "Are you deleting this for real?");
Maybe you might add something like this in a future version: a simple and generic way to pass a key-value map to override any hard-coded UI Label strings?
Anyway, for the moment (Version 6.0.0), is there also a way to get a reference to this “Yes, delete” button so I could replace the caption there as well?
Thanks!
Set a concrete implementation so you don’t have to cast anything:
GridCrud<User> crud = new GridCrud<>(User.class, new HorizontalSplitCrudLayout());
Check the last example in the add-on page to see how to customize button captions.
Got it, great, thank you!, Alejandro