【问题标题】:Getting clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay is not a function获取 clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay 不是函数
【发布时间】:2016-12-19 20:06:57
【问题描述】:

我收到以下异常:

Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError) : $tmp_0_g$.get_clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay_28_g$(...).style_129_g$ is not a function
    at Unknown.fBj_g$(BillingOverviewView_BinderImpl.java:75)
    at Unknown.KPi_g$(BillingOverviewView_BinderImpl.java:43)
    at Unknown.GPi_g$(BillingOverviewView_BinderImpl.java:31)
    at Unknown.HPi_g$(BillingOverviewView_BinderImpl.java:28)
    at Unknown.APi_g$(BillingOverviewView.java:34)

但仅在 Firefox 中。它在 Chrome 中没有任何问题。

这是堆栈跟踪中提到的视图:

class BillingOverviewView extends ViewWithUiHandlers<BillingOverviewUiHandlers> implements BillingOverviewPresenter.MyView {

    @SuppressWarnings("unused")
    private final static Logger LOGGER = Logger.getLogger(BillingOverviewView.class.getName());

    interface Binder extends UiBinder<Widget, BillingOverviewView> {
    }

    @UiField MaterialRow rowShops;

    @Inject
    BillingOverviewView(Binder uiBinder) {
        this.initWidget(uiBinder.createAndBindUi(this));
    }

    @Override
    public void clearShopCards() {
        this.rowShops.clear();
    }

    @Override
    public void addShopCard(MyView view) {
        MaterialColumn colShop = new MaterialColumn(12, 12, 12);
        colShop.add(view);
        this.rowShops.add(colShop);
    }

}

知道这是从哪里来的吗?为什么我只在 Firefox 中得到这个?

我实际操作 ID 的唯一地方是这里:

@Inject
PaymentMethodTabView(Binder uiBinder) {

    String id = HTMLPanel.createUniqueId();

    this.btnPaymentMethod = new MaterialButton();
    this.btnPaymentMethod.setText("PM");
    this.btnPaymentMethod.setActivates(id);

    this.dpPaymentMethod = new MaterialDropDown(id);
    this.dpPaymentMethod.setConstrainWidth(false);

    this.dpPaymentMethod.addSelectionHandler(new SelectionHandler<Widget>() {
        @Override
        public void onSelection(SelectionEvent<Widget> event) {
            if(!(event.getSelectedItem() instanceof CreditCardDropDownItem)) {
                return;
            }
            CreditCardDropDownItem item = ((CreditCardDropDownItem)event.getSelectedItem());
            CreditCard creditCard = PaymentMethodTabView.this.tokenToCreditCard.get(item.getToken());
            PaymentMethodTabView.this.onSelection(creditCard);
        }
    });

    this.initWidget(uiBinder.createAndBindUi(this));

    this.creditCardContainer.setWidget(this.creditCardWidget);
}

但正如您所见,我使用 HTMLPanel.createUniqueId() 来确保我获得了唯一的 ID。

有什么想法吗?

【问题讨论】:

    标签: firefox gwt


    【解决方案1】:

    在此添加gss="true"

    <ui:style gss="true">
    
    .shop-panel {
        margin: 30px;
        padding: 30px;
    
        border-style: solid;
        border-right: 0;
        border-left: 0;
        border-width: 1px;
        border-color: #AAAAAA;
    }
    
    .main-content {
        height: 100%;
        overflow: auto;
    }
    
    </ui:style>
    

    成功了。

    【讨论】:

      猜你喜欢
      • 2021-09-29
      • 2022-01-03
      • 2018-11-20
      • 2018-02-15
      • 1970-01-01
      • 1970-01-01
      • 2019-05-03
      • 2021-07-13
      • 2018-01-11
      相关资源
      最近更新 更多