Uploaded image for project: 'Errai'
  1. Errai
  2. ERRAI-1028

Method clear() of @DataField HTMLPanel field hungs up the browser

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Critical
    • Resolution: Unresolved
    • Affects Version/s: 4.0.0.CR1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      GWT 2.8, Errai 4.0.0.CR1

    • Steps to Reproduce:
      Hide
      1. Add some errai managed instance of Composite to HTMLPanel (instantiated by Errai as @DataField)
      2. Call clear() on the HTMLPanel
        ER: the panel is cleared
        AR: endless loop (it tries to remove all elements in the panel but loops in the iterator.remove() calls)

      It reproduces in several places in our application after migration from Errai 3.2

      Show
      Add some errai managed instance of Composite to HTMLPanel (instantiated by Errai as @DataField) Call clear() on the HTMLPanel ER: the panel is cleared AR: endless loop (it tries to remove all elements in the panel but loops in the iterator.remove() calls) It reproduces in several places in our application after migration from Errai 3.2
    • Workaround Description:
      Hide

      Workaround #1

      Luckily I used HTMLPanel only for one widget to put into. So I changed it to SimplePanel and used setWidget. But it still did not work.
      I figured out that the problem is in proxying of widget I am trying to add to Panel. I called asWidget method and it works now:

      private void displayCenterView(final CustomerManagementCenterView centerViewContent)

      { centerContainer.setWidget(centerViewContent.asWidget()); }

      Probably it will work for HTMLPanel as well. But anyway the proxying problem worth fixing.

      Workaround #2

      In step 1 (See steps to reproduce) use non-proxied version of a Composite: centerContainer.add(centerViewContent.asWidget())

      Show
      Workaround #1 Luckily I used HTMLPanel only for one widget to put into. So I changed it to SimplePanel and used setWidget. But it still did not work. I figured out that the problem is in proxying of widget I am trying to add to Panel. I called asWidget method and it works now: private void displayCenterView(final CustomerManagementCenterView centerViewContent) { centerContainer.setWidget(centerViewContent.asWidget()); } Probably it will work for HTMLPanel as well. But anyway the proxying problem worth fixing. Workaround #2 In step 1 (See steps to reproduce) use non-proxied version of a Composite: centerContainer.add(centerViewContent.asWidget())

      Description

      @ApplicationScoped
      @Templated("#template")
      public class CustomerManagementView extends Composite {

      @DataField
      private HTMLPanel centerContainer = new HTMLPanel("");

      private void displayCenterView(final Widget centerViewContent)

      { centerContainer.clear(); centerContainer.add(centerViewContent); }

      }

      Call method displayCenterView when centerContainer not empty. It causes browser to go into endless loop.
      Widget centerViewContent - is another Composite child and Errai-managed bean. Proxying seems to be the problem.

      VNm_g$ (InternalPreconditions.java:139)
      dOm_g$ (InternalPreconditions.java:129)
      OEe_g$ (Cast.java:75)
      IGt_g$ (Type_factory__c…fault.java:363)
      duf_g$ (ComplexPanel.java:62)
      _jg_g$ (WidgetCollection.java:61)
      Gtf_g$ (Panel.java:75)
      a$h_g$ (CustomerManagem…tView.java:156)
      ZZh_g$ (CustomerManagem…tView.java:127)
      Nlt_g$ (Type_factory__c…fault.java:131)
      BXh_g$ (CustomerManagem…enter.java:431)
      Bit_g$ (Type_factory__c…fault.java:464)
      Cit_g$ (Type_factory__c…fault.java:462)
      VZn_g$ (AbstractCDIEven…llback.java:52)
      W_n_g$ (CDI.java:329)
      M_n_g$ (CDI.java:317)
      S_n_g$ (CDI.java:302)
      V_n_g$ (CDI.java:170)
      U_n_g$ (CDI.java:141)
      T$n_g$ (EventProvider.java:63)
      Y$h_g$ (CustomerNavigat…senter.java:97)
      lot_g$ (Type_factory__c…fault.java:225)
      mot_g$ (Type_factory__c…fault.java:223)
      VZn_g$ (AbstractCDIEven…llback.java:52)
      W_n_g$ (CDI.java:329)
      M_n_g$ (CDI.java:317)
      S_n_g$ (CDI.java:302)
      V_n_g$ (CDI.java:170)
      U_n_g$ (CDI.java:141)
      T$n_g$ (EventProvider.java:63)
      j$h_g$ (CustomerManagem…tView.java:109)
      y$h_g$ (CustomerManagementView.java:94)
      Qof_g$ (Event.java:195)
      Pof_g$ (Event.java:194)
      V7d_g$ (GwtEvent.java:76)
      sie_g$ (EventBus.java:40)
      Die_g$ (SimpleEventBus.java:193)
      Jie_g$ (SimpleEventBus.java:88)
      kie_g$ (HandlerManager.java:127)
      Rof_g$ (Event.java:87)
      tof_g$ (Event.java:480)
      enf_g$ (DOM.java:1458)
      ssf_g$ (DOMImplStandard.java:341)
      TIc_g$ (Impl.java:239)
      WIc_g$ (Impl.java:291)
      (anonymous) (Impl.java:77)

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                mbarkley Max Barkley
                Reporter:
                klimskiy Ivan Klimskiy
              • Votes:
                9 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: