Search code examples
thymeleafspring-roo

How can i prevent roo console from regenerating the thymeleaf views? (ROO2 RC1)


Maybe it's because i'm approaching the thymeleaf views in a wrong way but i couldn't find the best way to do it yet. I have my roo generated project with their thymeleaf views, i needed to delete some fields from the form, lock some other and many more little changes like css and js. My problem is that everytime i open the roo console, it overwrite all my editions and leaves the views as they come by default. There is some way to exclude my edited views from regenerating? or is there some better way to edit the views?

Thanks.


Solution

  • To prevent that Spring Roo removes your changes including the default items you sould include the data-z="user-managed" attribute in that items you want to maintain.

    Remember that the data-z="user-managed" attribute is only available in that elements that have id attribute.

    Of course, if you are going to change a big number of fields or you're going to change the HTML structure of an specific form, you should include the data-z="user-managed" in the <body> element.

    After that, if you open the Spring Roo shell, any change will be applied.

    Hope it helps,