Attachable by Mario David project migrated from cuba 6 to 7

Hi,

I recently migrated my project from cuba 6 to 7. Now i’m trying to add this add-on to my project. I followed the steps as subscribed but no button is been added to my browser screen. The browser screen is as far as i can see still a cuba 6 screen.

This i followed:

Browse Screens

Annotate your browse screens with the @WithAttachments annotation or by implementing the WithAttachmentsSupport interface, depending on which version of CUBA screen APIs is used in the target screen.

@WithAttachments annotation (CUBA 6 screens)

@WithAttachments(listComponent = “productsTable”) class ProductBrowse extends AnnotatableAbstractLookup { }

For the @WithAttachments annotation you need to define the list component on which it should add the attachments button. Normally this is the id of the table you defined in your browse screen.

Update:

I’ve noticed that when i remove my report button from the controller of the browser screen the attachment button is shown.

Controller:

@Inject
private Button reportButton;
@Inject
protected ButtonsPanel buttonsPanel;
@Inject
private GroupTable districtMarowijnesTable;

@Override
public void init(Map<String, Object> params) {
    TablePrintFormAction action = new TablePrintFormAction("report", districtMarowijnesTable);
    districtMarowijnesTable.addAction(action);
    reportButton.setAction(action);

Hi,

I assume you forgot to call super.init() within your overridden lifecycle method. This should solve the problem.

When switching to CUBA 7 based controller with the WithAttachmentSupport, this quirk is gone.

Cheers
Mario

Thanks Mario. problem solved