IDEMPIERE-925 Date field shows error for incorrect format but allow user to proceed on ok button / peer review

This commit is contained in:
Juan David Arboleda 2013-05-31 18:06:48 -05:00
parent 1a54f69c34
commit e11d43b059
1 changed files with 18 additions and 18 deletions

View File

@ -1337,14 +1337,14 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
Object value = null; Object value = null;
//Allowing Date validation before save //Allowing Date validation before save
List<Component> compoList = cellQueryFrom.getChildren(); Component compo = cellQueryFrom.getFirstChild();
if(compoList.get(0) instanceof Datebox) { if(compo instanceof Datebox) {
Datebox dbox = (Datebox)compoList.get(0); Datebox dbox = (Datebox)compo;
if(dbox.getValue() != null) if(dbox.getValue() != null)
value = new Timestamp(((Date)dbox.getValue()).getTime()); value = new Timestamp(((Date)dbox.getValue()).getTime());
} }
else if(compoList.get(0) instanceof DatetimeBox) { else if(compo instanceof DatetimeBox) {
DatetimeBox dtbox = (DatetimeBox)compoList.get(0); DatetimeBox dtbox = (DatetimeBox)compo;
if(dtbox.getValue() != null) if(dtbox.getValue() != null)
value = new Timestamp(((Date)dtbox.getValue()).getTime()); value = new Timestamp(((Date)dtbox.getValue()).getTime());
} }
@ -1391,14 +1391,14 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
ListCell cellQueryTo = (ListCell)row.getFellow("cellQueryTo"+row.getId()); ListCell cellQueryTo = (ListCell)row.getFellow("cellQueryTo"+row.getId());
//Allowing Date validation before save //Allowing Date validation before save
compoList = cellQueryTo.getChildren(); compo = cellQueryTo.getFirstChild();
if(compoList.get(0) instanceof Datebox) { if(compo instanceof Datebox) {
Datebox dbox = (Datebox)compoList.get(0); Datebox dbox = (Datebox)compo;
if(dbox.getValue() != null) if(dbox.getValue() != null)
value2 = new Timestamp(((Date)dbox.getValue()).getTime()); value2 = new Timestamp(((Date)dbox.getValue()).getTime());
} }
else if(compoList.get(0) instanceof DatetimeBox) { else if(compo instanceof DatetimeBox) {
DatetimeBox dtbox = (DatetimeBox)compoList.get(0); DatetimeBox dtbox = (DatetimeBox)compo;
if(dtbox.getValue() != null) if(dtbox.getValue() != null)
value2 = new Timestamp(((Date)dtbox.getValue()).getTime()); value2 = new Timestamp(((Date)dtbox.getValue()).getTime());
} }