sea*_*ste 3 java gwt gwt-editors
我只是忙着使用它Editor framework并移植我的所有表格来使用它.我的Event表格上遇到了一些麻烦.我有5个不同的time fields- 对于每个字段,我使用a DateBox来允许用户选择时间.
在我的旧时代,我Activity将这些字段的值转换为Long时间,填充我的proxy object并坚持下去.
我想用这个做同样的事情Editor framework.无论如何我可以使用Editora DateBox来填充Long我的域对象中的字段.我敢肯定必须有办法做到这一点,我只是难以搞清楚.
如果情况并非如此,我现在暂时无法做到这一点,是否有人知道如何做到这一点的好方法?
Tho*_*yer 10
你必须包裹DateBox在Editor<Long>.就像是:
@Editor.Ignore
@UiField
DateBox dateField;
LeafValueEditor<Long> longField = new LeafValueEditor<Long>() {
@Override
public Long getValue() {
Date date = dateField.getValue();
return date == null ? null : date.getTime();
}
@Override
public void setValue(Long value) {
Date date = value == null ? null : new Date(value.longValue());
dateField.setValue(date);
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1844 次 |
| 最近记录: |