2016-03-24 24 views
2

GWT için oldukça yeniyim. Bazı standart widget'ları ihtiyaçlarıma uyacak şekilde genişletmek istiyorum. Ben GWT MaterialDesign (Here is demo ve here are sources) sınıfları uzatmak benim ilk Widget HorizontalTabs yarattık Ve bir hata alıyorum:GWT - özel pencere aracı hatası: undefined özelliği 'karma' özelliği okunamıyor

public class HorizontalTabs extends Composite { 

    private static HorizontalTabsUiBinder uiBinder = GWT.create(HorizontalTabsUiBinder.class); 

    interface HorizontalTabsUiBinder extends UiBinder<Widget, HorizontalTabs> { 
    } 
public HorizontalTabs() { 
    initWidget(uiBinder.createAndBindUi(this)); 
    } 
} 

<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent"> 
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" 
    xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:m="urn:import:gwt.material.design.client.ui"> 
    <m:MaterialRow> 
     <m:MaterialRow> 
      <m:MaterialColumn grid="s12"> 
       <m:MaterialTab ui:field="tab" backgroundColor="blue" indicatorColor="yellow" waves="YELLOW"> 

       </m:MaterialTab> 
      </m:MaterialColumn> 
     </m:MaterialRow> 
     <m:MaterialRow ui:field="tabContentRow"> 

     </m:MaterialRow> 
    </m:MaterialRow> 
</ui:UiBinder> 

o ekliyorum kullanmak için: Cannot read property 'hash' of undefined İşte

bakış kodudur Benim görüş sınıfımdan birine aşağıdaki gibi:

public class FilesView extends ViewWithUiHandlers<FilesUiHandlers> implements FilesPresenter.MyView { 
    interface Binder extends UiBinder<Widget, FilesView> {} 
    private static FilesViewUiBinder uiBinder = GWT.create(FilesViewUiBinder.class); 
    interface FilesViewUiBinder extends UiBinder<Widget, FilesView> {} 
    @UiField 
    MaterialRow row; 
    public FilesView() { 
    initWidget(uiBinder.createAndBindUi(this)); 
    row.add(new HorizontalTabs()); 
    } 

<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent"> 
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" 
     xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:m="urn:import:gwt.material.design.client.ui"> 
    <g:HTMLPanel> 
     <h2>Your files</h2> 
     <m:MaterialRow> 
      <m:MaterialRow ui:field="row"> 
      </m:MaterialRow> 
     </m:MaterialRow> 
    </g:HTMLPanel> 
</ui:UiBinder> 

Everythink tamamlar derler. Ancak bu widget'ı içeren görünüme girmeye çalıştığımda sorunlar ortaya çıkıyor. İşte

Yığın izleme:

SEVERE: Exception caught: Exception caught: Exception caught: Exception caught: Exception caught: Exception caught: (TypeError) : Cannot read property 'hash' of undefinedcom.google.gwt.user.client.ui.AttachDetachException: Exception caught: Exception caught: Exception caught: Exception caught: Exception caught: Exception caught: (TypeError) : Cannot read property 'hash' of undefined 
    at Unknown.fillInStackTrace_0_g$([email protected]:8443) 
    at Unknown.Throwable_3_g$([email protected]:8398) 
    at Unknown.Exception_3_g$([email protected]:8541) 
    at Unknown.RuntimeException_3_g$([email protected]:8582) 
    at Unknown.UmbrellaException_3_g$([email protected]:36497) 
    at Unknown.UmbrellaException_5_g$([email protected]:36558) 
    at Unknown.AttachDetachException_1_g$([email protected]:55009) 
    at Unknown.tryCommand_1_g$([email protected]:55065) 
    at Unknown.doAttachChildren_1_g$([email protected]:54662) 
    at Unknown.onAttach_2_g$([email protected]:54494) 
    at Unknown.setParent_2_g$([email protected]:54590) 
    at Unknown.adopt_0_g$([email protected]:54649) 
    at Unknown.add_14_g$([email protected]:54707) 
    at Unknown.add_13_g$([email protected]:54700) 
    at Unknown.add_66_g$([email protected]:77215) 
    at Unknown.add_11_g$([email protected]:54637) 
    at Unknown.add_65_g$([email protected]:77211) 
    at Unknown.setPanelContent_0_g$([email protected]:114885) 
    at Unknown.setInSlot_7_g$([email protected]:107982) 
    at Unknown.setInSlot_1_g$([email protected]:73077) 
    at Unknown.setInSlot_0_g$([email protected]:73066) 
    at Unknown.execute_27_g$([email protected]:76290) 
    at Unknown.$executeScheduled_0_g$([email protected]:11660) 
    at Unknown.runScheduledTasks_0_g$([email protected]:11382) 
    at Unknown.flushPostEventPumpCommands_0_g$([email protected]:11474) 
    at Unknown.execute_5_g$([email protected]:11613) 
    at Unknown.execute_4_g$([email protected]:11350) 
    at Unknown.apply_0_g$([email protected]:10845) 
    at Unknown.entry0_0_g$([email protected]:10901) 
    at Unknown.anonymous([email protected]:10881) 
    at Unknown.callback_0_g$([email protected]:11401) 
Caused by: com.google.gwt.user.client.ui.AttachDetachException: Exception caught: Exception caught: 

Ben bu saçma sorun olduğunu varsayalım, ama gerçekten çözüm bulamıyor. Lütfen yardım et.

Belki de neden bulmanın yolu var, ancak çalışma zamanı istisnasını bulmam gerektiğinde GWT uygulamasında hata ayıklaması çok zor.

+0

Her iki widget'ım da gayet iyi çalışıyor (gwtp sınıfları olmadan), hiçbir şey bana yanlış geliyor. Dosyaya neden olan sorunu bulmak için uygulamanızda hata ayıklamaya çalışın. – Ajax

cevap

0

Herhangi bir kamu alıcısı ve pencere öğesi modeli nesneleri için belirleyiciler ve yapıcılar olmadı. Ama şimdi emin değilim. Çalışmaya başladı.

İlgili konular