[UiBinder] LazyDomElement : erreur "Cannot find element"
Salut,
J'ai une remontée d'erreur fréquente sur mon application GWT.
D'après le stacktrace elle survient lors du constructeur de la classe CrossingRow, qui correspond à un composant graphique créé via un UiBinder.
Code:
1 2 3 4 5
| Class$S241: Cannot find element with id "gwt-uid-76". Perhaps it is not attached to the document body.
at com.google.gwt.uibinder.client.LazyDomElement.$get(LazyDomElement.java:66)
at com.xxxxx.widgets.CrossingRow_CrossingRowUiBinderImpl$Widgets.$build_f_HTMLPanel1(CrossingRow_CrossingRowUiBinderImpl.java:83)
at com.xxxxx.widgets.CrossingRow.CrossingRow(CrossingRow.java:41)
at com.xxxxx.widgets.CrossingsGridsWidget.$buildCell(CrossingsGridsWidget.java:174) |
Le XML de l'UiBinder correspond à ceci (et je n'y vois rien d'extraordinaire) :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
| <!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">
<g:HTMLPanel styleName="crossingRow">
<div ui:field="bestprice"></div>
<g:HTMLPanel styleName="price" ui:field="pricePanel">
<input type="radio" ui:field="radio" />
<span ui:field="price"></span>
</g:HTMLPanel>
<div class="hours" ui:field="hours"></div>
<g:FlowPanel styleName="icons" ui:field="icons" />
</g:HTMLPanel>
</ui:UiBinder> |
Le code Java de la classe étant lui aussi relativement simple, puisque je ne fait que remplir le contenu HTML des éléments :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| public class CrossingRow extends Composite {
private static CrossingRowUiBinder uiBinder = GWT
.create(CrossingRowUiBinder.class);
interface CrossingRowUiBinder extends UiBinder<Widget, CrossingRow> {
}
@UiField InputElement radio;
@UiField Element bestprice;
@UiField HTMLPanel pricePanel;
@UiField Element price;
@UiField Element hours;
@UiField FlowPanel icons;
public CrossingRow(String name, Crossing c, PriceItem item,
Currency currency, boolean isBestPrice) {
initWidget(uiBinder.createAndBindUi(this));
this.radio.setName(name);
if (isBestPrice) {
this.bestprice.addClassName("bestprice");
this.bestprice.setInnerHTML(ClientFactory.INSTANCE.getMessages()
.Label_TarifMoinsCher());
}
if (item != null && item.getAmount() != null) {
this.price.setInnerHTML(UtilsUI.formatAmount(item.getAmount(), currency));
}
this.hours.setInnerHTML("<strong>" + Dates.formatTime(c.getDeparture())
+ "</strong> - " + Dates.formatTime(c.getArrival()));
if (c.getAvailability()!=Availability.OK) {
this.pricePanel.add(Crossings.availability(c));
}
Crossings.promotions(c, this.icons);
Crossings.advantages(c, this.icons);
}
} |
Mais le plus curieux c'est que je ne reçois ce genre d'erreur qu'en provenance de navigateur sous Android 2.3...
Si quelqu'un a une idée de l'origine de cela...
:merci:
a++