Used of generic screen

Can anyone share a sample app / codes how generic screen feature in CUBA is used? for example, I want to provide the Entity name as parameter with/without the list of fields, the same generic screen can be used to display and then help select the entity for any database table e.g. Customer, Employee, Vendor etc. I want to return the selected entity (customer/vendor…) back to the screen from where the screen was called in.

Do you mean using Entity Inspector as a lookup screen?

May be similar to that. I give you an example. I will have only one common screen to show list of entities in a table or even data from several tables based on the SQL I use. I shall use it with a button and pop it up from where the selected row or I’d can be bring back to the previous screen who called it.

Try to use entityInspector.browse screen with entity parameter:


openLookup("entityInspector.browse", 
        (items) -> {
            // handle selected items
        }, 
        OpenType.THIS_TAB, 
        ParamsMap.of("entity", "sample$Customer"));