我收到以下异常:
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。
有什么想法吗?
答案 0 :(得分:2)
向此添加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>
诀窍。