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

CollectionChangeListener is invoked twice if table sorting is saved in settings #1885

Closed
Flaurite opened this issue Feb 18, 2019 · 1 comment
Assignees
Labels
state: fixed Fixed by the developer type: bug Something isn't working ver: 7.0.2 Fixed in version ver: 7.1.0 Fixed in version
Milestone

Comments

@Flaurite
Copy link
Contributor

Flaurite commented Feb 18, 2019

Environment

  • Platform version: 7.0.1

Description of the bug or enhancement

Probably, it applies also to DataGrid and Table inheritors.
Attached project: demo.zip

  • Minimal reproducible example
    In the attached project:
  1. Create some customers;
  2. In the CustomerBrowse screen set sorting to some column; close screen;
  3. Open CustomerBrowse screen again.
  • Expected behavior
    Only one notification with "CollectionChange" should be shown.
  • Actual behavior
    Two notifications are shown.
@Flaurite Flaurite added the type: bug Something isn't working label Feb 18, 2019
@Flaurite Flaurite added this to the Release 7.0 milestone Feb 18, 2019
@knstvk knstvk changed the title CollectionChangeListener is invoked after column sorting CollectionChangeListener is invoked twice if table sorting is saved in settings Feb 22, 2019
@haulmont-git haulmont-git added the ver: 7.0.2 Fixed in version label Feb 22, 2019
@haulmont-git haulmont-git added the ver: 7.1.0 Fixed in version label Feb 22, 2019
@knstvk
Copy link
Member

knstvk commented Feb 22, 2019

In order to have only one CollectionChangeEvent when screen is opened with saved sorting, you should remove the LoadDataBeforeShow annotation and load data in AfterShowEvent listener:

@UiController("demo_Customer.browse")
@UiDescriptor("customer-browse.xml")
@LookupComponent("customersTable")
//@LoadDataBeforeShow
public class CustomerBrowse extends StandardLookup<Customer> {

    @Subscribe
    private void onAfterShow(AfterShowEvent event) {
        getScreenData().loadAll();
    }

@natfirst natfirst assigned natfirst and myatlevEvg and unassigned natfirst Feb 27, 2019
@myatlevEvg myatlevEvg added the state: fixed Fixed by the developer label Mar 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: fixed Fixed by the developer type: bug Something isn't working ver: 7.0.2 Fixed in version ver: 7.1.0 Fixed in version
Projects
None yet
Development

No branches or pull requests

5 participants