The problem is that when parsing <tr><td><span id='gwt-uid-67-></span></td></tr> as innerHTML, the <tr> and <td> and simply dropped, so the HTMLPanel's root element actually becaomes the <span id='gwt-uid-67'>.
Try it for yourself: http://jsfiddle.net/7FhnW/
Maybe the IE-specific workaround is no longer needed and we could now createElement("tr").setInnerHTML("<td><span id='gwt-uid-67'></span></td>") which would work (at least in Chrome, haven't tested anywhere else).
I doubt it though: http://msdn.microsoft.com/en-us/library/ie/ms533897(v=vs.85).aspx
"The innerHTML property is read-only on the col, colGroup, frameSet, html, head, style, table, tBody, tFoot,tHead, title, and tr objects."
Or maybe the IE-specific code could be pushed behind deferred binding.
Anyway, I think it's unsafe to use any table element as HTMLPanel's tag. Maybe we should just call it out in the doc…
On Tuesday, July 23, 2013 4:56:29 PM UTC+2, David Ignjić wrote:
-- On Tuesday, July 23, 2013 4:56:29 PM UTC+2, David Ignjić wrote:
Hello,I have problem with widget:Ui binder file:<!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:t="urn:import:com. umantis.talent.client. thirdappraisal.widget"> <g:HTMLPanel tag="tr"><td><g:Label ui:field="label"></g:Label></td> <td><g:Label ui:field="period"></g:Label></td> <td><g:Label ui:field="description"></g:Label></td> <td><t:ValueRadioList ui:field="givenAnswer"></t:ValueRadioList></td> <td><g:DoubleBox ui:field="scoreValue"></g:DoubleBox></td> <td><g:TextArea ui:field="givenComment"></g:TextArea></td> </g:HTMLPanel></ui:UiBinder>Java file:package com.umantis.talent.client.thirdappraisal; import java.util.Map;import com.google.gwt.core.client.GWT; import com.google.gwt.editor.client.Editor; import com.google.gwt.text.shared.AbstractRenderer; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiField; import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.DoubleBox; import com.google.gwt.user.client.ui.Label; import com.google.gwt.user.client.ui.TextArea; import com.google.gwt.user.client.ui.Widget; import com.umantis.talent.client.thirdappraisal.widget. ValueRadioList; import com.umantis.talent.shared.dto.thirdpartyappraisal. ThirdPartyAppraisalQuestionEva luationModel; public class QuestionEvaluationEditor extends Composite implements Editor<ThirdPartyAppraisalQuestionEva luationModel> { private static QuestionEvaluationEditorUiBinder uiBinder = GWT.create( QuestionEvaluationEditorUiBind er.class); interface QuestionEvaluationEditorUiBinder extends UiBinder<Widget, QuestionEvaluationEditor> { }@UiFieldLabel label;@UiFieldLabel period;@UiFieldLabel description;@UiField(provided = true)ValueRadioList<Long> givenAnswer;@UiFieldDoubleBox scoreValue;@UiFieldTextArea givenComment;private Map<Long, String> dynamicListAnswers;public QuestionEvaluationEditor() {givenAnswer = new ValueRadioList<Long>(new AbstractRenderer<Long>() {@Overridepublic String render(Long object) {return dynamicListAnswers.get(object); }});initWidget(uiBinder.createAndBindUi(this)); }public void setDynamicListAnswers(Map<Long, String> dynamicListAnswers) { this.dynamicListAnswers = dynamicListAnswers;givenAnswer.setAcceptableValues( dynamicListAnswers.keySet()); }}I get the errorjava.lang.RuntimeException: Cannot find element with id "gwt-uid-67". Perhaps it is not attached to the document body.at com.google.gwt.uibinder.client.LazyDomElement.get( LazyDomElement.java:70) at com.umantis.talent.client.thirdappraisal. QuestionEvaluationEditor_ QuestionEvaluationEditorUiBind erImpl$Widgets.build_f_ HTMLPanel1( QuestionEvaluationEditor_ QuestionEvaluationEditorUiBind erImpl.java:89) at com.umantis.talent.client.thirdappraisal. QuestionEvaluationEditor_ QuestionEvaluationEditorUiBind erImpl$Widgets.get_f_ HTMLPanel1( QuestionEvaluationEditor_ QuestionEvaluationEditorUiBind erImpl.java:79) at com.umantis.talent.client.thirdappraisal. QuestionEvaluationEditor_ QuestionEvaluationEditorUiBind erImpl$Widgets.access$0( QuestionEvaluationEditor_ QuestionEvaluationEditorUiBind erImpl.java:78) at com.umantis.talent.client.thirdappraisal. QuestionEvaluationEditor_ QuestionEvaluationEditorUiBind erImpl.createAndBindUi( QuestionEvaluationEditor_ QuestionEvaluationEditorUiBind erImpl.java:30) at com.umantis.talent.client.thirdappraisal. QuestionEvaluationEditor_ QuestionEvaluationEditorUiBind erImpl.createAndBindUi( QuestionEvaluationEditor_ QuestionEvaluationEditorUiBind erImpl.java:1) at com.umantis.talent.client.thirdappraisal. QuestionEvaluationEditor.< init>( QuestionEvaluationEditor.java: 55) But if I change line<g:HTMLPanel tag="tr"> to <g:HTMLPanel> all working as expected.I looked into source and problem is with this linesetElement(scratchDiv.getFirstChildElement()); -->this line getElement().removeFromParent(); Ok How to solve this ?.Thanks David Ignjic
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment