Skip to content

Commit

Permalink
Extra 4 | Bind picture resource to image component
Browse files Browse the repository at this point in the history
  • Loading branch information
amahdy committed Jun 1, 2017
1 parent 15c70cf commit f9308f4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/org/vaadin/stepbystep/PersonEditorView.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.vaadin.stepbystep;

import com.vaadin.data.Binder;
import com.vaadin.server.ExternalResource;
import org.vaadin.stepbystep.person.backend.Person;

import java.util.function.Consumer;
Expand All @@ -20,5 +21,7 @@ public PersonEditorView(Consumer<Person> consumer) {

public void setPerson(Person value) {
binder.setBean(value);

picture.setSource(new ExternalResource(value.getPicture()));
}
}

0 comments on commit f9308f4

Please sign in to comment.