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
85 stars 54 forks source link

CrudFormFactory is missing setButtonCaption #132

Closed LuboZ closed 2 months ago

LuboZ commented 3 months ago

Hi, i would like to rename buttons in dialog, but missing setButtonCaption method. Also please how can i rename header text of the dialog ?

Thank you

alejandro-du commented 2 months ago

For button captions, you need a reference to a concrete implementation of CrudFormFactory. Then you can call the appropriate method. For example:

var formFactory = new DefaultCrudFormFactory(User.class);
formFactory.setButtonCaption(CrudOperation.ADD, "Add new user");

Similarly, for form captions, you need a concrete implementation of CrudLayout. Then you can call the appropriate method. For example:

var layout = new VerticalCrudLayout();
layout.setFormCaption(CrudOperation.UPDATE, "Update user");
LuboZ commented 2 months ago

Thank you very much 👍