Closed watho closed 5 years ago
Hi, thanks for your PR. Unfortunately, I cannot merge this since it changes the central idea of a generic CRUD: "Copy" is not a CRUD operation but a combination of custom logic plus the Create operation. For this user-specific requirements, you can add a button to the UI with the CrudLayout.addToolbarComponent(Element)
method and invoke the logic to copy data in a click listener.
Thank you for this gread add-on.
For my needs i have added a Copy-Operation which might be interesting for you too despite the fact that this is no real CRUD-Operation.
It is similar to Add-Operation but new Items are populated with properties of currently selected item. Copy functionality is inside CrudListener.preCopy and uses Jackson-ObjectMapper as default. I have added an usage example in the README.md.
It is only tested with WindowBasedCrudLayout cause i don't use the other ones.