58 for(
final FieldDef fd : getCategoryFields()) {
64 if(fd.getJavaClass().equals(String.class)) {
65 final Textbox value =
new Textbox();
67 value.setText((String) getFieldValue(dossier, fd));
68 value.addEventListener(Events.ON_CHANGE,
new EventListener() {
70 public void onEvent(Event event)
throws Exception {
71 setFieldValue(dossier, fd, value.getText());
75 }
else if(fd.getJavaClass().equals(Long.class)) {
76 final Longbox value =
new Longbox();
77 value.setValue((Long) getFieldValue(dossier, fd));
78 value.addEventListener(Events.ON_CHANGE,
new EventListener() {
80 public void onEvent(Event event)
throws Exception {
81 setFieldValue(dossier, fd, value.getValue());
85 }
else if(fd.getJavaClass().equals(Double.class)) {
86 final Doublebox value =
new Doublebox();
87 value.setValue((Double) getFieldValue(dossier, fd));
88 value.addEventListener(Events.ON_CHANGE,
new EventListener() {
90 public void onEvent(Event event)
throws Exception {
91 setFieldValue(dossier, fd, value.getValue());
95 }
else if(fd.getJavaClass().equals(Date.class)) {
96 final Datebox value =
new DateboxShort();
97 value.setValue((Date) getFieldValue(dossier, fd));
98 value.addEventListener(Events.ON_CHANGE,
new EventListener() {
100 public void onEvent(Event event)
throws Exception {
101 setFieldValue(dossier, fd, value.getValue());
105 }
else if(fd.getJavaClass().equals(Boolean.class)) {
106 final Checkbox value =
new Checkbox();
107 Boolean b = (Boolean) getFieldValue(dossier, fd);
108 value.setChecked(b ==
null ?
false : b);
109 value.addEventListener(Events.ON_CHECK,
new EventListener() {
111 public void onEvent(Event event)
throws Exception {
112 setFieldValue(dossier, fd, value.isChecked());
GridLayout addComponent(HtmlBasedComponent comp)
GridLayout addCaption(String label)