Skip to content

Commit

Permalink
Make it possible to use an extended ComboBox in declarative files (#8651
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Artur- authored and hesara committed Feb 22, 2017
1 parent 04a20bf commit 1718666
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
Expand Up @@ -176,8 +176,9 @@ private static void resolveSupportedAttributes(Class<?> clazz) {
.getPropertyDescriptors()) {
Method getter = descriptor.getReadMethod();
Method setter = descriptor.getWriteMethod();
if (getter != null && setter != null && getFormatter()
.canConvert(descriptor.getPropertyType())) {
Class<?> propertyType = descriptor.getPropertyType();
if (getter != null && setter != null && propertyType != null
&& getFormatter().canConvert(propertyType)) {
String attribute = toAttributeName(descriptor.getName());
entry.addAttribute(attribute, getter, setter);
}
Expand Down
Expand Up @@ -70,6 +70,20 @@ public void comboBoxSpecificPropertiesSerialize() {
testWrite(design, comboBox);
}

@Test
public void extendedComboBox() {
ExtendedComboBox combo = new ExtendedComboBox();
String design = "<html>" //
+ "<head>" //
+ "<meta name='package-mapping' content='com_vaadin_tests_server_component_combobox:com.vaadin.tests.server.component.combobox'>"
+ "</meta>" + "</head>" + "<body>"
+ "<com_vaadin_tests_server_component_combobox-extended-combo-box>"
+ "</com_vaadin_tests_server_component_combobox-extended-combo-box>"
+ "</body></html>";
testWrite(design, combo);
testRead(design, combo);
}

@Test
public void optionStylesSerialization() throws InstantiationException,
IllegalAccessException, InvocationTargetException {
Expand Down
@@ -0,0 +1,8 @@
package com.vaadin.tests.server.component.combobox;

import com.vaadin.tests.data.bean.Person;
import com.vaadin.ui.ComboBox;

public class ExtendedComboBox extends ComboBox<Person> {

}

0 comments on commit 1718666

Please sign in to comment.