Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

activate() method is not triggered when You enter again to cached presenter #143

Closed
masterdany88 opened this issue Sep 11, 2020 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@masterdany88
Copy link
Contributor

masterdany88 commented Sep 11, 2020

Activate method is not triggered when You reenter to cached presenter
Deactivate method is triggered always when You leave cached presenter
Seams like inconcistency for me
Activate method is triggered only once at start, when You enter first time cached presenter.
But every time You are leaving cached presenter method deactivate() is triggered.

Issue occurs only when You declare caching in top of composites Controller like this:

@Controller(
        route = Routes.NETWORK_CONFIGURATION,
        selector = HTMLSelectors.CONTENT,
        componentInterface = INetworkComponent.class,
        component = NetworkComponent.class
)
@Composites({
        @Composite(name = NetworkHTMLSelectors.NETWORK_CONFIGURATION_LAN_SELECTOR,
                compositeController = LanController.class,
                selector = NetworkHTMLSelectors.NETWORK_CONFIGURATION_LAN_SELECTOR),
        @Composite(name = NetworkHTMLSelectors.NETWORK_CONFIGURATION_WIFI_SELECTOR,
                compositeController = WifiController.class,
                selector = NetworkHTMLSelectors.NETWORK_CONFIGURATION_WIFI_SELECTOR),
})
public class NetworkController extends AbstractComponentController<QBAPContext, INetworkComponent, HTMLElement>
        implements INetworkComponent.Controller {

    @Override
    public void start() {
        router.storeInCache(this);
    }
}

When I declare caching in inner controller then it is ok I got active method one each entering and I got deactivate on each leaving .f.e.:

@CompositeController(
        componentInterface = IWifiComponent.class,
        component = WifiComponent.class
)
public class WifiController extends AbstractCompositeController<QBAPContext, IWifiComponent, HTMLElement> implements IWifiComponent.Controller {
        router.storeInCache(this);
}  
```
@FrankHossfeld FrankHossfeld self-assigned this Sep 11, 2020
@FrankHossfeld FrankHossfeld added the bug Something isn't working label Sep 11, 2020
@FrankHossfeld FrankHossfeld added this to the 2.1.0 milestone Sep 11, 2020
@FrankHossfeld
Copy link
Collaborator

to make it clear: we are talking about the activate-method of a CompositeComponentController inside a cached ComponentController. The activate-method the cached ComponentController is called.

Correct?

FrankHossfeld added a commit that referenced this issue Sep 12, 2020
@FrankHossfeld
Copy link
Collaborator

The activate method of the composites get called. Fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants