Accessing Uibinders DOM element in View and Presenter

28 views
Skip to first unread message

Jose

unread,
Jan 18, 2014, 8:16:02 AM1/18/14
to gwt-pl...@googlegroups.com
Hi All,
 
I have input, div, span, select elements in my uibinders file. How can I access those elements in view and presenter class.
 
So that, I can convert into TextBx.wrap(Element element) and attach handlers to it for validation.
 
I tried, using DOM.getElementById() in onBind() it returns null, because DOM is not attached yet and I tried it in onReveal it returns the Element, but not able to use TextBx.wrap(Element element);
 
it throws
 
java.lang.AssertionError: A widget that has an existing parent widget may not be added to the detach list    
at com.google.gwt.user.client.ui.RootPanel.detachOnWindowClose(RootPanel.java:136)    
at com.google.gwt.user.client.ui.TextBox.wrap(TextBox.java:69)
 
I tried to access in View class constructor, No use.
 
right place to get the DOM element?
 
Please help me,
 
Thanks In Advance,
Bennet.

Clay Harris

unread,
Jan 18, 2014, 8:24:34 PM1/18/14
to gwt-pl...@googlegroups.com
I think the error message is telling you what the problem is - the element already has a parent widget (the uibinder widget, perhaps).  But if you want access to the element using a widget - why not just create the widget you want in the UIBinder?  That would avoid the whole problem


--
You received this message because you are subscribed to the Google Groups "GWTP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gwt-platform...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages