Skip to content

Commit

Permalink
QIEntityView: added method for building and binding DateFields
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfinc committed Jul 31, 2017
1 parent 3c268f9 commit 05445cb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions modules/qi-core/src/main/java/org/jpos/qi/QIEntityView.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package org.jpos.qi;

import com.vaadin.data.*;
import com.vaadin.data.converter.LocalDateToDateConverter;
import com.vaadin.data.converter.StringToBigDecimalConverter;
import com.vaadin.data.converter.StringToIntegerConverter;
import com.vaadin.data.converter.StringToLongConverter;
Expand Down Expand Up @@ -542,6 +543,13 @@ protected TextField buildAndBindTimestampField(String id) {
return field;
}

protected DateField buildAndBindDateField(String id) {
DateField dateField = new DateField(getCaptionFromId(id));
Binder.BindingBuilder builder = formatField(id,dateField);
builder.withConverter(new LocalDateToDateConverter()).bind(id);
return dateField;
}

protected TextField buildAndBindBigDecimalField(String id) {
TextField field = new TextField(getCaptionFromId(id));
Binder.BindingBuilder builder = formatField(id,field);
Expand Down

0 comments on commit 05445cb

Please # to comment.