I am trying ot use the DatePicker that the user created here:
http://advanced-gwt.sourceforge.net/demo/index.html => *Text and
Button Widgets* tab => Select a date.
In the *Source Code* section it imports this:
import org.gwt.advanced.client.ui.widget.DatePicker;
I downloaded the relative jar and imported it in my EntryPoint class.
In Eclipse i F3 on it to see the source code, and it opens DatePicker
in package org.gwt.advanced.client.ui.widget, which is the one that I
want. And it means that the source is there.
Try to compile it and I get the error copied below.
I believe i need to inherit it, or need to specify the source path in
Monkee.gwt.xml, but don't know how to do it. And the source code of
the whole project I downloaded is a bit too complicated for me to
understand, as I am still a beginner.
Does anyone have an idea?
Also, not being a GWT standard widget, can it still be declared in a
UIBinder xml?
Thanks a lot in advance!
[ERROR] Errors in 'file:/home/dan/dev/ws/Monkee/src/com/monkee/
client/Monkee.java'
[ERROR] Line 44: No source code is available for type
org.gwt.advanced.client.ui.widget.DatePicker; did you forget to
inherit a required module?
Finding entry point classes
[ERROR] Unable to find type 'com.monkee.client.Monkee'
[ERROR] Hint: Previous compiler errors may have made this
type unavailable
[ERROR] Hint: Check the inheritance chain from your module;
it may not be inheriting a required module or a module may not be
adding its source path entries properly
I would guess you did forget to inherit the right module, because GWT
Compiler only includes sourcecode for included GWT modules. You have
to add the following line to your project .gwt.xml file:
<inherits name='org.gwt.advanced.Grid'/>
> Also, not being a GWT standard widget, can it still be declared in a
> UIBinder xml?
Yes, this is possibly! You have to import the package of the widget
using xml namespace declaration:
<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
xmlns:g='urn:import:com.google.gwt.user.client.ui'
xmlns:adv='urn:import:org.gwt.advanced.client.ui.widget'>
<g:HTMLPanel>
<!-- usage of datepicker -->
<adv:DatePicker ... />
</g:HTMLPanel>
</ui:UiBinder>
If the datepicker has no no-args constructor then you have to supply a
@UiFactory Method in your UiBinder class. You should have a look at
http://code.google.com/webtoolkit/doc/latest/DevGuideUiBinder.html#Using_a_widget
I wasn't aware of the right value for *inherits*. I have just realised
it's the gwt.xml file without the extension...
Thanks!
> @UiFactory Method in your UiBinder class. You should have a look athttp://code.google.com/webtoolkit/doc/latest/DevGuideUiBinder.html#Us...