67 for(
final FieldDef fd : getTabFields()) {
68 final Row row =
new Row();
70 rows.appendChild(row);
72 row.appendChild(
new Label(I_.get(fd.getLabelKey())));
74 if(fd.getJavaClass().equals(String.class)) {
75 final FieldValueCombobox value =
new FieldValueCombobox(fd);
77 value.setFieldValue((String) getFieldValue(contact, fd));
78 value.addEventListener(Events.ON_CHANGE,
new EventListener() {
80 public void onEvent(Event event)
throws Exception {
81 setFieldValue(contact, fd, value.getFieldValue());
84 row.appendChild(value);
85 }
else if(fd.getJavaClass().equals(Long.class)) {
86 final Longbox value =
new Longbox();
87 value.setValue((Long) getFieldValue(contact, fd));
88 value.addEventListener(Events.ON_CHANGE,
new EventListener() {
90 public void onEvent(Event event)
throws Exception {
91 setFieldValue(contact, fd, value.getValue());
94 row.appendChild(value);
95 }
else if(fd.getJavaClass().equals(Double.class)) {
96 final Doublebox value =
new Doublebox();
97 value.setValue((Double) getFieldValue(contact, fd));
98 value.addEventListener(Events.ON_CHANGE,
new EventListener() {
100 public void onEvent(Event event)
throws Exception {
101 setFieldValue(contact, fd, value.getValue());
104 row.appendChild(value);
105 }
else if(fd.getJavaClass().equals(Date.class)) {
106 final Datebox value =
new DateboxShort();
107 value.setValue((Date) getFieldValue(contact, fd));
108 value.addEventListener(Events.ON_CHANGE,
new EventListener() {
110 public void onEvent(Event event)
throws Exception {
111 setFieldValue(contact, fd, value.getValue());
114 row.appendChild(value);
115 }
else if(fd.getJavaClass().equals(Boolean.class)) {
116 final Checkbox value =
new Checkbox();
117 Boolean b = (Boolean) getFieldValue(contact, fd);
118 value.setChecked(b ==
null ?
false : b);
119 value.addEventListener(Events.ON_CHECK,
new EventListener() {
121 public void onEvent(Event event)
throws Exception {
122 setFieldValue(contact, fd, value.isChecked());
125 row.appendChild(value);