I am following the tutorial, download and run the git project on https://www.cuba-platform.com/guides/intro-working-with-data-in-cuba. On the method
" private void openVisitDetails(Visit visit) {
screenBuilders
.editor(Visit.class, this)
.editEntity(visit)
.withLaunchMode(OpenMode.NEW_TAB)
.build()
.show();
}
of public class CreateVisitForPet extends Screen
I want to create a second edit screen for Visit class which can be used for creating a Pet visit (Now it seems editing a pet visit and creating a pet visit using the same form. How can i pass data to that second edit screen ? I tried this but fails
You need to pass a reference to the owner, not the class name. For example, if you have three screens: VisitBrowse, VisitEdit and PersonEdit, then when you need to call PersonEdit from VisitEdit like this:
My situation is not like that. I created two different screens for same entity. PersonEdit and PersonEdit2. On the PersonBrowser, i want pass the data of one person instance to the person edit screen 2
That code above works when two screens are from totally different Entities. Anyway i found this way to work. I don’t know it has any side effects though