You need to hook in a custom WidgetBuilder to do this. Your custom WidgetBuilder only need worry about creating a Date widget for a 'long', and can return null for everything else:
Your custom WidgetBuilder needs to be something like:
public class MyWidgetBuilder implements WidgetBuilder<Component, VaadinMetawidget> {
public Component buildWidget( String elementName, Map<String, String> attributes, VaadinMetawidget metawidget ) {
if ( "long".equals( attributes.get( TYPE ))) {
return new PopupDateField();
}
return null;
}
}
Then you wrap it inside a CompositeWidgetBuilder so that Metawidget 'falls back' to the regular VaadinWidgetBuilder for everything else. Here's an example: http://metawidget.org/doc/reference/en/html/ch02s04.html#section-architecture-widgetbuilders-implementing-your-own
VaadinMetawidget has some default WidgetBuilders already, so you may want to include those too. Here are the defaults: http://metawidget.org/doc/reference/en/html/ch02s04.html#section-architecture-widgetbuilders-defaults