2016-07-15 7 views
1

com.vaadin.ui.ConnectorTracker unregisterConnector警告の登録を解除しようとしました: 登録解除(83)しようとした、ここで vaadinのMSG警告:

に登録されていない私のコードは、この警告を引き起こしています。これは、単純なコンポーネントをアプレットコンポーネントアドオンに置き換えます。ボタンをクリックするだけで

appletConponent.handleClickを(呼び出す)

アプレットが動作しますが、私はログに警告MSGを参照してください。

static class AppletComponent extends CustomComponent{ 
    Component appletComponent; 
    VerticalLayout container; 
    String contextRoot; 

    void construct(){ 
     container= new VerticalLayout(); 
     setCompositionRoot(container); 
     contextRoot=VaadinServlet.getCurrent().getServletContext().getContextPath(); 
     // initialize with empty component 
     container.addComponent(appletComponent= new Label()); 
    } 
    void handleClick(){ 
      addApplet(); 
     } 
    } 

    void addApplet(){ 
     try{ 
      String appletParam=gatesSession.getPathParameter(); 
      Component oldComponent=appletComponent; 
      Component newComponent=new AppletIntegration() { 
       private static final long serialVersionUID = 1L; 
       @Override 
       public void attach() { 
        // applet codebase,archive url 
       } 
      }; 
      container.replaceComponent(oldComponent, newComponent); 
      appletComponent= newComponent; 
     }catch(Exception e){ 
      logger.error(" could not create session ",e); 
      Notification.show("Cannot Launch ","failed"+ e.getMessage(),Type.ERROR_MESSAGE); 
     } 
    } 
+1

オーバーライドされたattach()メソッドでは、super.attach()を呼び出す必要があります。 –

+0

ありがとう、問題を修正しました。 – user884424

答えて

4

コンポーネントのattach()メソッドをオーバーライドするだけでなくsuper.attach()を呼び出すことを忘れないでください:

@Override 
public void attach() { 
    super.attach(); // Don't forget this! 
} 

同じことがdetach()に適用されます。