Refreshing screen fragments from host screen

I am displaying statistics of collection as shown in image in browse screens. These indicators are screen frames showing data taken using service beans.


    private void onAfterInit(AfterInitEvent event) {

I want to refresh these frames by table refresh button click or preferably whenever there are changes in entities.

How can I refresh these frames?




I would recommend refresh frames in the CollectionChangeEvent handler, so every time the data container is refreshed, items are added or removed you will be notified.


Sorry, but i am not able to conceive the code to refresh the frame.

    private Pendingcm fragment1;

    @Subscribe(id = "complianceMonitoringsDc", target = Target.DATA_CONTAINER)
    private void onComplianceMonitoringsDcCollectionChange(CollectionContainer.CollectionChangeEvent<ComplianceMonitoring> event) {
        //what should be code here?

How can I refresh frgment1 or its label componenet and fire bean? May please suggest code.



Thanks, Got it. Just mistake on my part (the function was defined private, so i am not able to access it.)

As far as I understand, currently you refresh frames only when the screen is opened. I assumed that you will move the code that refreshes frames from onAfterInit to onComplianceMonitoringsDcCollectionChange. It seems that I misunderstood and onAfterInit is a code from a frame, not from the hosting screen. In this case, We’d greatly appreciate if you manage to create a sample project demonstrating the issue.

Thanks @gorelov

The issue is resolved. I shifted on refresh code to new public function and called that from host screen.