Closed GoogleCodeExporter closed 8 years ago
Code which causes the problem:
private static TimeItem createTimeItem(Integer aHours, Integer aMinutes) {
final TimeItem theTimeItem = new TimeItem();
theTimeItem.setShowTitle(false);
theTimeItem.setUseTextField(false);
theTimeItem.setShowHourItem(true);
theTimeItem.setShowMinuteItem(true);
theTimeItem.setShowSecondItem(false);
theTimeItem.setShowMillisecondItem(false);
theTimeItem.disable();
if(aHours != null) {
theTimeItem.setHours(aHours);
}
if(aMinutes != null) {
theTimeItem.setMinutes(aMinutes);
}
return theTimeItem;
}
Original comment by sven.strohschein@googlemail.com
on 28 Jan 2014 at 12:35
Use setValue() to set a value. The crash above is happening because the value
is currently null (we'll improve the error reporting).
Original comment by smartgwt...@gmail.com
on 28 Jan 2014 at 5:22
Ah, ok, that is working. Thank you for your fast support.
I would suggest to provide a better error message and to improve the
documentation. I hadn't thought that it can be set with setValue, because the
format isn't clear. Is there any documentation where it is described that the
value can be set with setValue in combination with setInputFormat?
Original comment by sven.strohschein@googlemail.com
on 28 Jan 2014 at 5:39
There's no need to pass a String, setValue() has several signatures and one
takes a Date. However, be sure you have read the Date and Time Format and
Storage overview so you correctly create the Date (with createLogicalTime()).
Original comment by smartgwt...@gmail.com
on 28 Jan 2014 at 5:52
Original issue reported on code.google.com by
sven.strohschein@googlemail.com
on 28 Jan 2014 at 12:33