View Full Version : appearance attribute for ui xml missing but present in examples code

14 Apr 2014, 5:03 AM
In the GXT 3.1 examples there is a appearance attribute in AccordionLayout(UiBinder) demo. Here the screen shot:

I thought that the setAppearance method has been introduced with 3.1 beta but after trying to use the appearance attribute in my ui xml file, I always get an error saying:

Class ContentPanel has no appropriate setAppearance() method: <gxt:ContentPanel appearance='{contentPanelAppearance}' ui:field='messagePanel'> (:58)

Can anyone explain why is the appearance there in examples but is still missing in 3.1 beta jars? :-/

Colin Alworth
14 Apr 2014, 9:52 AM
There is no setter and never has been for appearances, on any widget, since that would rebuild the widget and require details already complete in the constructor to be run again. The accordion example works because there is a @UiFactory method defined in the java file (AccordionUiBinderExample.java):

public ContentPanel createContentPanel(ContentPanelAppearance appearance) {
return new ContentPanel(appearance);

With UiBinder, you can either make a constructor argument required, or not at all, that's it. See http://www.gwtproject.org/doc/latest/DevGuideUiBinder.html#Using_a_widget for more possible options on this topic.