User inbox add-on documentation issue, or oversight?

On the readme for the user inbox add-on, the example code for installing it onto a standard main screen are:

import de.diedavids.cuba.userinbox.web.screens.UserInboxMessageMenuBadge;

public class CustomApplicationMainScreen extends MainScreen {

    @Inject
    protected SideMenu sideMenu;
    @Inject
    protected Timer updateCountersTimer;

    @Inject
    protected UserInboxMessageMenuBadge userInboxMessageMenuBadge;

    @Subscribe
    protected void onInit(InitEvent event) {
        userInboxMessageMenuBadge.initMessagesMenuItem(
                sideMenu,
                updateCountersTimer,
                this
        );
    }

    @Subscribe
    protected void onAfterShow(AfterShowEvent event) {
        userInboxMessageMenuBadge.updateMessageCounter(sideMenu);
    }

    @Subscribe("updateCountersTimer")
    protected void onUpdateCountersTimerTimerAction(Timer.TimerActionEvent event) {
        userInboxMessageMenuBadge.updateMessageCounter(sideMenu);
    }
}

But it seems the Timer is never instantiated, because running the app then gives you:

DevelopmentException: Unable to find an instance of type 'interface com.haulmont.cuba.gui.components.Timer' named 'updateCountersTimer' for instance of 'com.medflex.medflexj.web.screens.ExtMainScreen'

There’s no Timer to inject, so I think what’s needed is instantiating one. I’m going to look into the source of the demo project to figure it out - but I think the readme needs updated.

Actually what’s required is putting the timer into the descriptor:

        <timer id="updateCountersTimer" delay="3000"  autostart="true" repeating="true" />

That should be added to/mentioned in the readme!

Hi,

Right I forgot to mention it. Can you create a PR for the Readme.md?

Thanks
Mario

Hmm? I’ve not done that before! (Very small, stone-age company here; we’re modernizing slowly.)