Migration to CUBA 7 API: Browser / Lookup Screens

Please note that your entire codebase should work on the new version of the framework only with minor changes listed in the release notes, i.e. you don’t need to migrate existing screens on the new API, but if you want, the following guide may be helpful.

Table of Contents

Migration to CUBA 7 API: Screens
Migration to CUBA 7 API: Browser / Lookup Screens
Migration to CUBA 7 API: Editor Screens
Migration to CUBA 7 API: Required Components Migration
Migration to CUBA 7 API: Optional Components Migration

XML descriptor migration

Please read the previous sections before continuing with this.

Add lookupActions box at the very bottom of a lookup screen.

<hbox id="lookupActions"
      spacing="true"
      visible="false">
    <button action="lookupSelectAction"/>
    <button action="lookupCancelAction"/>
</hbox>

Controller migration

  • Extend the com.haulmont.cuba.gui.screen.StandardLookup class instead of com.haulmont.cuba.gui.components.AbstractLookup.
  • Define the @LookupComponent annotation with the lookup component id, e.g. @LookupComponent("productsTable").

Note: StandardLookup has a parameter with a type of entity.

Minimal browser implementation

@UiController("sales_Product.browse")
@UiDescriptor("product-browse.xml")
@LookupComponent("productsTable")
@LoadDataBeforeShow
public class ProductBrowse extends StandardLookup<Product> {
}
3 Likes