Dear Support,
I'm trying to create a Canvas Item containing two DateItem's to have full control on the layout, as suggested in the DateRangeItem documentation.
Here is a minimalist source code:
I link this custom item to a field named "CREATED" in a dynamic form:
The problem I have is that the two date pickers are disabled, whatever I do... BUT, If I rename my field in the datasource like this:
... and of course link my canvas item to FOO instead of CREATED, everything works as expected.
... So my question is simple... is the word "CREATED" reserved for some internal features of SmartGwt ?
Thanks,
Thomas
I'm trying to create a Canvas Item containing two DateItem's to have full control on the layout, as suggested in the DateRangeItem documentation.
Here is a minimalist source code:
Code:
import java.util.Date; import com.fircosoft.cdb.client.localization.Localization; import com.smartgwt.client.data.Criterion; import com.smartgwt.client.types.OperatorId; import com.smartgwt.client.types.TextMatchStyle; import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.form.FormItemCriterionGetter; import com.smartgwt.client.widgets.form.fields.CanvasItem; import com.smartgwt.client.widgets.form.fields.FormItem; public class FormDateRangeItem extends CanvasItem { FormDateItem fromItem = new FormDateItem(); FormDateItem toItem = new FormDateItem(); DynamicForm form = new DynamicForm(); public FormDateRangeItem(String name, String title) { super(name, Localization.translate(title)); fromItem.setShowTitle(false); fromItem.setName(name + "_FROM"); fromItem.setOperator(OperatorId.GREATER_OR_EQUAL); toItem.setOperator(OperatorId.LESS_OR_EQUAL); toItem.setTitle("$toDateRange"); toItem.setName(name + "_TO"); form.setNumCols(3); form.setItems(fromItem, toItem); form.setColWidths(160, 50, 160); this.setShouldSaveValue(true); this.setCriterionGetter(new FormItemCriterionGetter() { @Override public Criterion getCriterion(DynamicForm form, FormItem item, TextMatchStyle textMatchStyle) { return new Criterion(item.getName(), OperatorId.BETWEEN_INCLUSIVE, fromItem.getValueAsDate(), toItem.getValueAsDate()); } @Override public Criterion getCriterion(DynamicForm form, FormItem item) { return new Criterion(item.getName(), OperatorId.BETWEEN_INCLUSIVE, fromItem.getValueAsDate(), toItem.getValueAsDate()); } }); this.setCanvas(form); } }
Code:
<field name="CREATED" type="creatorTimestamp" title="$created" hidden="false" />
Code:
<field name="FOO" type="creatorTimestamp" title="$created" hidden="false" nativeName="CREATED"/>
... So my question is simple... is the word "CREATED" reserved for some internal features of SmartGwt ?
Thanks,
Thomas
Comment