Contacts are shown.

master
Markus Kreth 7 years ago
parent eaa2219cb8
commit f89c6a6529
  1. 14
      src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/ui/components/PersonEditDetails.java

@ -19,6 +19,7 @@ import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.VerticalLayout;
import de.kreth.vaadin.clubhelper.vaadinclubhelper.dao.PersonDao; import de.kreth.vaadin.clubhelper.vaadinclubhelper.dao.PersonDao;
import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Contact;
import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Gender; import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Gender;
import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.GroupDef; import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.GroupDef;
import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Person; import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Person;
@ -160,6 +161,7 @@ public class PersonEditDetails extends HorizontalLayout {
if (person != null) { if (person != null) {
okButton.setEnabled(true); okButton.setEnabled(true);
updateRelationshipBinding(); updateRelationshipBinding();
updateContactBinding();
} else { } else {
okButton.setEnabled(false); okButton.setEnabled(false);
contactLayout.removeAllComponents(); contactLayout.removeAllComponents();
@ -167,6 +169,18 @@ public class PersonEditDetails extends HorizontalLayout {
} }
} }
private void updateContactBinding() {
contactLayout.removeAllComponents();
Person current = binder.getBean();
List<Contact> contacts = current.getContacts();
for (Contact c : contacts) {
TextField textField = new TextField(c.getType());
textField.setValue(c.getValue());
textField.setEnabled(false);
contactLayout.addComponent(textField);
}
}
private void updateRelationshipBinding() { private void updateRelationshipBinding() {
relationshipLayout.removeAllComponents(); relationshipLayout.removeAllComponents();
Person current = binder.getBean(); Person current = binder.getBean();

Loading…
Cancel
Save